bash - Why can't /usr/bin/cd go to $OLDPWD -
ran interesting can't quite figure out reason for. whenever use bash's builtin cd, can use cd -
, when use cd executable errors out error saying: /usr/bin/cd: line 2: cd: oldpwd not set
here's transcript:
$ cd /tmp $ cd $home $ echo $oldpwd /tmp $ /usr/bin/cd - /usr/bin/cd: line 2: cd: oldpwd not set $ declare -xp oldpwd declare -x oldpwd="/tmp"
i not sure cd
executable comes from, pointless: can change own wd, not caller's (i. e. shell's). cd
builtin , can work such.
Comments
Post a Comment