aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bash/bashrc1
-rw-r--r--bash/bashrc.d/cd.bash1
-rw-r--r--sh/profile1
3 files changed, 3 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
diff --git a/sh/profile b/sh/profile
index 5e4f5891..efe47283 100644
--- a/sh/profile
+++ b/sh/profile
@@ -19,4 +19,5 @@ if [ -d "$HOME"/.profile.d ]; then
. "$file"
done
fi
+unset file