Re: $(pwd) != $(/bin/pwd)

2010-01-07 Thread Marc Herbert
Chet Ramey a écrit : > How often does the directory change out from under a > shell process, after which it calls pwd? Depends on what you mean by "change". Very often for testing purposes I re-run some software installer that deletes and re-creates the "tested" directory. So I need to run "cd ."

Re: $(pwd) != $(/bin/pwd)

2010-01-06 Thread Chet Ramey
On 1/6/10 1:46 PM, Stephane CHAZELAS wrote: > 2010-01-05 16:40:50 -0500, Chet Ramey: >>> Well, if I read >>> http://www.opengroup.org/onlinepubs/9699919799/utilities/pwd.html >>> correctly, bash pwd should output /home/darkk/bar in that case >>> as $PWD does *not* contain an absolute path to the cu

Re: $(pwd) != $(/bin/pwd)

2010-01-06 Thread Stephane CHAZELAS
2010-01-05 16:40:50 -0500, Chet Ramey: > > Well, if I read > > http://www.opengroup.org/onlinepubs/9699919799/utilities/pwd.html > > correctly, bash pwd should output /home/darkk/bar in that case > > as $PWD does *not* contain an absolute path to the current > > directory. > > Bash notices this wh

Re: $(pwd) != $(/bin/pwd)

2010-01-05 Thread Chet Ramey
> Well, if I read > http://www.opengroup.org/onlinepubs/9699919799/utilities/pwd.html > correctly, bash pwd should output /home/darkk/bar in that case > as $PWD does *not* contain an absolute path to the current > directory. Bash notices this when running in posix mode, and recanonicalizes the pat

Re: $(pwd) != $(/bin/pwd)

2010-01-05 Thread Ken Irving
On Tue, Jan 05, 2010 at 08:23:39PM +0100, Andreas Schwab wrote: > Greg Wooledge writes: > > > On Mon, Jan 04, 2010 at 01:25:50PM +, Stephane CHAZELAS wrote: > >> >> da...@thinkpad ~/foo $ echo $PWD > >> >> /home/darkk/foo > > > >> Well, if I read > >> http://www.opengroup.org/onlinepubs/96999

Re: $(pwd) != $(/bin/pwd)

2010-01-05 Thread Stephane CHAZELAS
2010-01-05 20:23:39 +0100, Andreas Schwab: > Greg Wooledge writes: > > > On Mon, Jan 04, 2010 at 01:25:50PM +, Stephane CHAZELAS wrote: > >> >> da...@thinkpad ~/foo $ echo $PWD > >> >> /home/darkk/foo > > > >> Well, if I read > >> http://www.opengroup.org/onlinepubs/9699919799/utilities/pwd.h

Re: $(pwd) != $(/bin/pwd)

2010-01-05 Thread Andreas Schwab
Greg Wooledge writes: > On Mon, Jan 04, 2010 at 01:25:50PM +, Stephane CHAZELAS wrote: >> >> da...@thinkpad ~/foo $ echo $PWD >> >> /home/darkk/foo > >> Well, if I read >> http://www.opengroup.org/onlinepubs/9699919799/utilities/pwd.html >> correctly, bash pwd should output /home/darkk/bar in

Re: $(pwd) != $(/bin/pwd)

2010-01-05 Thread Greg Wooledge
On Mon, Jan 04, 2010 at 01:25:50PM +, Stephane CHAZELAS wrote: > >> da...@thinkpad ~/foo $ echo $PWD > >> /home/darkk/foo > Well, if I read > http://www.opengroup.org/onlinepubs/9699919799/utilities/pwd.html > correctly, bash pwd should output /home/darkk/bar in that case > as $PWD does *not*

Re: $(pwd) != $(/bin/pwd)

2010-01-05 Thread Stephane CHAZELAS
2010-01-03, 17:23(-05), Chet Ramey: [...] >> da...@thinkpad ~ $ cd foo [...] >> da...@thinkpad ~/foo $ mv ~/foo ~/bar [...] >> da...@thinkpad ~/foo $ echo $PWD >> /home/darkk/foo >> da...@thinkpad ~/foo $ pwd >> /home/darkk/foo >> da...@thinkpad ~/foo $ /bin/pwd >> /home/darkk/bar [...] > It's not

Re: $(pwd) != $(/bin/pwd)

2010-01-03 Thread Chet Ramey
On 1/3/10 8:02 AM, Leonid Evdokimov wrote: > Configuration Information [Automatically generated, do not change]: > Machine: i686 > OS: linux-gnu > Compiler: i686-pc-linux-gnu-gcc > Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' > -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-lin

Re: $(pwd) != $(/bin/pwd)

2010-01-03 Thread Jan Schampera
Leonid Evdokimov schrieb: > This problem may be fixed if bash does not optimise number of getcwd() calls, > but I'm not sure if the bug is really a _bug_, but not a sort of strange > feature. Sorry, I didn't read carefully enough :) J.

Re: $(pwd) != $(/bin/pwd)

2010-01-03 Thread Jan Schampera
Leonid Evdokimov schrieb: > This problem may be fixed if bash does not optimise number of getcwd() calls, > but I'm not sure if the bug is really a _bug_, but not a sort of strange > feature. Depends what 'bar' is above, assuming it's a (sym-)link or a bind here: IMHO this is not a bug. There sim