aboutsummaryrefslogtreecommitdiff
path: root/bin/dub
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-08-05 00:10:59 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-08-05 00:11:49 +1200
commit1879eebc785de78207dd83386028815b7b99ea18 (patch)
tree67653da81e884cc4200f87e8e074ee036ddf4999 /bin/dub
parentSwitch fnl()/scr() to use mktd(1) (diff)
downloaddotfiles-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/dub')
-rwxr-xr-xbin/dub4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/dub b/bin/dub
index bb3df442..706c95f0 100755
--- a/bin/dub
+++ b/bin/dub
@@ -5,7 +5,9 @@ cd -- "$dir" || exit
set -- *
[ -e "$1" ] || shift
set -- .* "$@"
-shift 2
+[ -e "$1" ] || shift
+[ "$1" = . ] && shift
+[ "$1" = .. ] && shift
du -ks -- "$@" |
sort -k1nr |
sed "$lines"q