[Bug 479910] New: bash builtin pwd results outdated value
https://bugzilla.novell.com/show_bug.cgi?id=479910 Summary: bash builtin pwd results outdated value Classification: openSUSE Product: openSUSE 11.1 Version: Final Platform: All OS/Version: openSUSE 11.1 Status: NEW Severity: Minor Priority: P5 - None Component: Basesystem AssignedTo: werner@novell.com ReportedBy: jsmeix@novell.com QAContact: qa@suse.de CC: jw@novell.com Found By: Development The bash builtin pwd results the outdated (wrong) value when the working directory name was changed "from outside" but /bin/pwd results always the currently right value. How to reproduce: user1@host$ mkdir /tmp/foo user2@host$ cd /tmp/foo user2@host$ pwd /tmp/foo user1@host$ mv /tmp/foo /tmp/bar user2@host$ pwd /tmp/foo user2@host$ /bin/pwd /tmp/bar As far as I remember this issue exists "since ever" so that there is perhaps a special reason why it is no bug but intentionally in the bash but then I would not understand why the bash builtin pwd and /bin/pwd differ. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=479910 User jsmeix@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=479910#c1 --- Comment #1 from Johannes Meixner <jsmeix@novell.com> 2009-02-26 06:15:14 MST --- It happens also in one same process: user@host$ mkdir /tmp/foo user@host$ cd /tmp/foo user@host$ pwd /tmp/foo user@host$ mv /tmp/foo /tmp/bar user@host$ pwd /tmp/foo user@host$ /bin/pwd /tmp/bar -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=479910 User werner@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=479910#c2 Dr. Werner Fink <werner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |WORKSFORME --- Comment #2 from Dr. Werner Fink <werner@novell.com> 2009-02-26 06:15:30 MST --- Do echo 'set -o physical' >> ~/.bashrc and be happy ... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=479910 User jsmeix@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=479910#c3 Johannes Meixner <jsmeix@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|WORKSFORME |INVALID --- Comment #3 from Johannes Meixner <jsmeix@novell.com> 2009-02-26 06:19:41 MST --- Many thanks! And sorry for the invalid bug report! -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=479910 User jsmeix@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=479910#c4 --- Comment #4 from Johannes Meixner <jsmeix@novell.com> 2009-02-26 06:46:02 MST --- Only FYI: Now I have in my ~/.bashrc: -------------------------------------------------------------------------- # By default \w results the outdated (wrong) value # when the working directory name was changed. # Do not rely on 'set -o physical' magic with whatever side-effects # "do not follow symbolic links when executing commands", see "help set" # but use /bin/pwd which results always the currently right value: export PS1='\u@\h:$(/bin/pwd) $ ' -------------------------------------------------------------------------- and be happy ... :-) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=479910 User jw@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=479910#c5 --- Comment #5 from Juergen Weigert <jw@novell.com> 2009-02-26 07:15:57 MST --- Good hint, thanks. This also helps me. It makes bash pwd do what /bin/pwd does per default. Btw, tcsh can be tuned to automatically update the path in the shell prompt like this: alias precmd 'set cwd=`pwd`' .. don't know how to do that with bash, though ... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=479910 User jw@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=479910#c6 --- Comment #6 from Juergen Weigert <jw@novell.com> 2009-02-26 07:17:52 MST --- ah, okay :-) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com