bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Andreas Schwab
Subject: Re: $(pwd) != $(/bin/pwd)
Date: Tue, 05 Jan 2010 20:23:39 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (gnu/linux)

Greg Wooledge <wooledg@eeg.ccf.org> writes:

> On Mon, Jan 04, 2010 at 01:25:50PM +0000, Stephane CHAZELAS wrote:
>> >> darkk@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* contain an absolute path to the current
>> directory.
>
> An "absolute pathname" is one that begins with a / character.  As
> opposed to a "relative pathname" which does not, and which is resolved
> relative to your current working directory.
>
> $PWD is always an absolute pathname.

There are two conditions: 1. absolute pathname and 2. to the current
directory.  The second one is violated.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]