[PATCH 2/3] hust_test: Add missing PWD variable and improve checking mechanism

Mike Frysinger vapier at gentoo.org
Sun Sep 6 06:29:28 UTC 2009


On Saturday 05 September 2009 19:17:46 Denys Vlasenko wrote:
> On Thursday 13 August 2009 10:17, Mike Frysinger wrote:
> > side
> > note -- setting PWD is the same thing as doing `cd`.  so `PWD=/` and `cd
> > /` are equivalent.
>
> I discovered that it is not true (in bash).
>
> Setting PWD does not do that. bash lies to you by showing wrong prompt:
>
> shadow:~# PWD=/
> shadow:/# PWD=/tmp
> shadow:/tmp# /bin/pwd
> /root
> shadow:/# set | grep PS1
> PS1='\h:\w\$ '
>
> Apparently, \w simply is substituted by $PWD, even if the value is wrong.

ah i was tricked by my prompt.  thanks for digging further than face value ;).
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20090906/aaaf3b8e/attachment.pgp>


More information about the busybox mailing list