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

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -