diff options
author | Mike Burns <mike@mike-burns.com> | 2013-06-11 01:34:53 +0200 |
---|---|---|
committer | Mike Burns <mike@mike-burns.com> | 2013-06-11 01:34:53 +0200 |
commit | e5a1db282189a6d2a5b54c2aa14d9250e5d6b48d (patch) | |
tree | 55adab88466e96ff87d955d2e27fb6a3876941ef | |
parent | 4ee73edab8d8bae44b8257c4c89f8485ab7d649f (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-x | bin/rcup | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -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 } |