On 11/18/15 2:44 PM, John Wiersba wrote:
> Why does bash clear OLDPWD when a child script is started?
Because a new shell does not have a `previous working directory'. It's
supposed to be set by cd, and if you haven't executed cd, you don't have
one.
It seems reasonable to inherit OLDPWD if it names a directory, in the same
way that the shell inherits PWD if it names the current directory, so we'll
try that for the next bash version.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU
chet@case.edu http://cnswww.cns.cwru.edu/~chet/