[ale] Quick LInux Quiz

Mike Murphy mike at tyderia.net
Mon Mar 15 17:34:08 EST 2004


the CHANGES included with the source says:

"Pathname canonicalization now leaves a leading `//' intact, as POSIX.1 
requires."

That's in the release notes for bash-2.01-release.

So it seems this was on purpose. In notes for newer releases there are 
number of allusions to adjustments to // behavior, so it seems that 
maybe this hasn't been a happy feature, but I think its definately a 
feature.

Looking harder, at the BASH FAQ this time, I see:

E10) Why does `cd //' leave $PWD as `//'?

POSIX.2, in its description of `cd', says that *three* or more leading
slashes may be replaced with a single slash when canonicalizing the
current working directory.

This is, I presume, for historical compatibility.  Certain versions of
Unix, and early network file systems, used paths of the form
//hostname/path to access `path' on server `hostname'.

So, there you go.

You can code around it as others have suggested, I guess.

Mike



Mike Murphy wrote:
> no, on bash 2.05b at least, if you type "cd //" and then do a pwd, it 
> says you are in "//", not "/", which is strange. I just tried pksh and 
> tscsh, and neither do that.
> 
> If you try "cd ///", that doesn't do anything wierd though, and puts you 
> in "/" as expected.
> 
> I've got to guess this is a bug of some sort. Google hasn't turned 
> anything up yet, so I'm endevouring to download the source and dust off 
> my c...
> 
> Mike
> 
> 
> Jason Vinson wrote:
> 
>> isn't that the same thing as cd /?
>>
>> at least that's what I see.
>>
>> Jason
>>
>>
>> On Mar 15, 2004, at 5:13 PM, Michael D. Hirsch wrote:
>>
>>> Quick!  What is the effect of "cd //"?  I sure guessed wrong.
>>>
>>> I don't really understand what is happening when I do that on RH 
>>> under bash.
>>> Can anyone explain this?
>>>
>>> Michael
>>> _______________________________________________
>>> Ale mailing list
>>> Ale at ale.org
>>> http://www.ale.org/mailman/listinfo/ale
>>
>>
>>
>> _______________________________________________
>> Ale mailing list
>> Ale at ale.org
>> http://www.ale.org/mailman/listinfo/ale
> 
> 

-- 

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Mike Murphy
781 Inman Mews Drive Atlanta GA 30307
Landline: 404-653-1070
Mobile: 404-545-6234
Email: mike at tyderia.net
Email Pager: pagemike at tyderia.net
AIM: mmichael453
JDAM: 33:45:14.0584N  84:21:43.038W
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+



More information about the Ale mailing list