From e5a1db282189a6d2a5b54c2aa14d9250e5d6b48d Mon Sep 17 00:00:00 2001 From: Mike Burns Date: Tue, 11 Jun 2013 01:34:53 +0200 Subject: 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. --- bin/rcup | 14 +++++++------- 1 file 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 } -- cgit v1.2.3