Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #11916

OLDPWD unset when bash starts

From John Wiersba <jrw32982@yahoo.com>
Newsgroups gnu.bash.bug
Subject OLDPWD unset when bash starts
Date 2015-11-19 14:49 +0000
Message-ID <mailman.220.1447944610.31583.bug-bash@gnu.org> (permalink)
References <898271888.7483238.1447944578571.JavaMail.yahoo.ref@mail.yahoo.com>

Show all headers | View raw


From: jrw32982@yahoo.com
To: bug-bash@gnu.org,bash@packages.debian.org
Subject: OLDPWD unset when bash starts

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='l$
uname output: Linux john-mint-mate-17 3.13.0-37-generic #64-Ubuntu SMP Mon Sep $
Machine Type: x86_64-pc-linux-gnu

Bash Version: 4.3
Patch Level: 11
Release Status: release

Description:

Why does bash clear OLDPWD when a child script is started?

OLDPWD is exported and passed to any children, but bash apparently clears OLDPWD whenever a child script is started:  Can bash be fixed to preserve the value of any OLDPWD in its initial environment, like it does with PWD?


This appears to happen on all 3.x and 4.x versions of bash.
Repeat-By:

$ cd /etc
$ cd
$ perl -e 'print "<$ENV{OLDPWD}>\n"'
</etc>
$ ksh -c 'echo "<$OLDPWD>"'
</etc>
$ bash -c 'echo "<$OLDPWD>"'
<>

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

OLDPWD unset when bash starts John Wiersba <jrw32982@yahoo.com> - 2015-11-19 14:49 +0000

csiph-web