diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-05 00:10:59 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-05 00:11:49 +1200 |
commit | 1879eebc785de78207dd83386028815b7b99ea18 (patch) | |
tree | 67653da81e884cc4200f87e8e074ee036ddf4999 /bin/cf | |
parent | Switch fnl()/scr() to use mktd(1) (diff) | |
download | dotfiles-1879eebc785de78207dd83386028815b7b99ea18.tar.gz dotfiles-1879eebc785de78207dd83386028815b7b99ea18.zip |
Handle different .* expansion in cf(1), dub(1)
OpenBSD seems to omit . and .. from its .* expansion (which actually
makes more sense to me), but Bash on Linux does not. This makes the
"shift 2" test more explicit.
Diffstat (limited to 'bin/cf')
-rwxr-xr-x | bin/cf | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -15,9 +15,12 @@ for dir in "${@:-.}" ; do set -- "$dir"/* [ -e "$1" ] || shift - # Add dot files, shift off the "." and ".." entries + # Add dot files, shift off the "." and ".." entries (sh(1) implementations + # seem to vary on whether they include these) set -- "$dir"/.* "$@" - shift 2 + [ -e "$1" ] || shift + [ "$1" = "$dir"/. ] && shift + [ "$1" = "$dir"/.. ] && shift # Print number of parameters printf '%u\t%s\n' "$#" "$dir" |