summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Mike Burns <mike@mike-burns.com>2013-06-11 01:34:53 +0200
committerGravatar Mike Burns <mike@mike-burns.com>2013-06-11 01:34:53 +0200
commite5a1db282189a6d2a5b54c2aa14d9250e5d6b48d (patch)
tree55adab88466e96ff87d955d2e27fb6a3876941ef
parent4ee73edab8d8bae44b8257c4c89f8485ab7d649f (diff)
Rename DIRSTACK to DIR_STACK
Some sysadmins mistakenly link `/bin/sh` to bash. Bash sets `DIRSTACK` and won't let you mutate it. This magical variable just so happens to be what I had named my directory stack variable in `popdir` and `pushdir`. Renaming it seems to fix it.
-rwxr-xr-xbin/rcup14
1 files changed, 7 insertions, 7 deletions
diff --git a/bin/rcup b/bin/rcup
index 65a2d0e..d733ea0 100755
--- a/bin/rcup
+++ b/bin/rcup
@@ -12,22 +12,22 @@ DEBUG=:
PRINT=echo
VERBOSE=:
PROMPT=echo
-DIRSTACK=":$DOTFILES_DIR"
+DIR_STACK=":$DOTFILES_DIR"
MKDIR=mkdir
LN=ln
RM=rm
pushdir() {
- DIRSTACK="$DIRSTACK:$PWD/$1"
- $DEBUG "cd'ing to $1 from `pwd` with stack $DIRSTACK"
+ DIR_STACK="$DIR_STACK:$PWD/$1"
+ $DEBUG "cd'ing to $1 from `pwd` with stack $DIR_STACK"
cd $1
}
popdir() {
- current=`echo $DIRSTACK | sed -e 's/.*://g'`
- prior=`echo $DIRSTACK | sed -e "s|:$current$||" | sed -e 's/.*://g'`
- DIRSTACK=`echo $DIRSTACK | sed -e 's/:[^:]*$//'`
- $DEBUG "cd'ing to $prior from `pwd` with stack $DIRSTACK"
+ current=`echo $DIR_STACK | sed -e 's/.*://g'`
+ prior=`echo $DIR_STACK | sed -e "s|:$current$||" | sed -e 's/.*://g'`
+ DIR_STACK=`echo $DIR_STACK | sed -e 's/:[^:]*$//'`
+ $DEBUG "cd'ing to $prior from `pwd` with stack $DIR_STACK"
cd $prior
}