diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2013-08-05 23:50:47 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2013-08-05 23:50:47 +1200 |
commit | 31793483b1cf33fc4df6bdd168be393a9ad34da6 (patch) | |
tree | 8023026f55247b4982479809c3c46dfbb5a2ef84 /bash/bashrc.d/cd.bash | |
parent | Initialise cd options to empty string (diff) | |
download | dotfiles-31793483b1cf33fc4df6bdd168be393a9ad34da6.tar.gz dotfiles-31793483b1cf33fc4df6bdd168be393a9ad34da6.zip |
Inline while loop in cd function with do
Diffstat (limited to 'bash/bashrc.d/cd.bash')
-rw-r--r-- | bash/bashrc.d/cd.bash | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/bash/bashrc.d/cd.bash b/bash/bashrc.d/cd.bash index 256acadd..3ee3329f 100644 --- a/bash/bashrc.d/cd.bash +++ b/bash/bashrc.d/cd.bash @@ -2,8 +2,7 @@ # emulating a Zsh function that I often find useful; preserves options too __cd() { local opts= - while getopts lPe opt - do + while getopts lPe opt; do opts="$opts -$opt" done shift $(($OPTIND-1)) |