aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-08-20 12:15:13 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-08-20 12:15:13 +1200
commit5c918328111bfdbdaa7838a8f10f499c30e98eeb (patch)
treed4c10212d18e892d41385bd1168719de965c5827
parentImprove error handling of cd() a bit (diff)
downloaddotfiles-5c918328111bfdbdaa7838a8f10f499c30e98eeb.tar.gz
dotfiles-5c918328111bfdbdaa7838a8f10f499c30e98eeb.zip
Remove option term spec from bd()
It doesn't accept options; cd() needs to because it's a wrapper
-rw-r--r--sh/shrc.d/bd.sh10
1 files changed, 3 insertions, 7 deletions
diff --git a/sh/shrc.d/bd.sh b/sh/shrc.d/bd.sh
index 0d1abbcf..5593ff4d 100644
--- a/sh/shrc.d/bd.sh
+++ b/sh/shrc.d/bd.sh
@@ -3,13 +3,9 @@ bd() {
# Set positional parameters to an option terminator and what will hopefully
# end up being a target directory
- set -- -- "$(
+ set -- "$(
- # If the first of the existing positional arguments is --, shift it
- # off
- [ "$1" = -- ] && shift
-
- # There's no more than one argument after that
+ # Check there's no more than one argument
[ "$#" -le 1 ] || exit 1
# The requested pattern is the first argument, defaulting to just the
@@ -63,5 +59,5 @@ bd() {
)" || return
# Try to change into the determined directory
- command cd "$@"
+ command cd -- "$@"
}