diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2013-08-05 23:50:25 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2013-08-05 23:50:25 +1200 |
commit | abfe43a8878d2c7195682f821178cfd6ff2057e2 (patch) | |
tree | e058cd2fa5653807da26973f3edc41c0d7c9b75c /bash | |
parent | More thorough quoting (diff) | |
download | dotfiles-abfe43a8878d2c7195682f821178cfd6ff2057e2.tar.gz dotfiles-abfe43a8878d2c7195682f821178cfd6ff2057e2.zip |
Initialise cd options to empty string
Diffstat (limited to 'bash')
-rw-r--r-- | bash/bashrc.d/cd.bash | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bash/bashrc.d/cd.bash b/bash/bashrc.d/cd.bash index 35900b7f..256acadd 100644 --- a/bash/bashrc.d/cd.bash +++ b/bash/bashrc.d/cd.bash @@ -1,9 +1,10 @@ # If given two arguments to cd, replace the first with the second in $PWD, # emulating a Zsh function that I often find useful; preserves options too __cd() { + local opts= while getopts lPe opt do - local opts="$opts -$opt" + opts="$opts -$opt" done shift $(($OPTIND-1)) if [[ $# -eq 2 ]]; then |