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

Denys Vlasenko vda.linux at googlemail.com
Thu Sep 10 06:02:30 UTC 2009


On Thursday 10 September 2009 02:20, Cathey, Jim wrote:
> >> Seems to me that bash 
> >> is doing exactly the right thing here.
> 
> >By lying to user? It misleads user by showing
> >current $PWD in the prompt, while user expects
> >to see name of the current directory.
> 
> No different, really, than the following scenario:
> 
> $ cd /tmp
> $ PS1="$PWD $"
> /tmp $ "PS1=/bin $"
> /bin $ /bin/pwd
> /tmp
> /bin $ #I'm so confused!
> 
> If _I_ do something stupid like override a variable that
> has meaning elsewhere, why shouldn't it bite me?  I _really_
> wouldn't want variables to be hooked up backwards, so that
> merely changing them drove other actions,

I do not propose to make PWD=/path to do "cd /path".

I merely say that interpreting \w in PS1 as "insert $PWD here"
is more confusing than "insert current dir here".

--
vda


More information about the busybox mailing list