aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
Diffstat (limited to 'bash')
-rw-r--r--bash/bashrc1
-rw-r--r--bash/bashrc.d/cd.bash1
2 files changed, 2 insertions, 0 deletions
diff --git a/bash/bashrc b/bash/bashrc
index 33155b82..5b55cf93 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -37,4 +37,5 @@ if [[ -d $HOME/.bashrc.d ]]; then
source "$file"
done
fi
+unset file
diff --git a/bash/bashrc.d/cd.bash b/bash/bashrc.d/cd.bash
index 320d614b..1b52fc01 100644
--- a/bash/bashrc.d/cd.bash
+++ b/bash/bashrc.d/cd.bash
@@ -1,6 +1,7 @@
# 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 opt OPTERR OPTIND
local -a opts
while getopts elP opt; do
opts[${#opts[@]}]=-$opt