[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cd // produces unexpected results
From: |
Stefano Lattarini |
Subject: |
Re: cd // produces unexpected results |
Date: |
Fri, 22 Jun 2012 23:58:57 +0200 |
On 06/22/2012 09:47 PM, Chet Ramey wrote:
>> By accident I keyed in :
>>
>> cd //
>>
>> and noticed that my prompt included both slashes.
>
> Posix says shells have to leave two leading slashes in a pathname alone.
> Three or more can be collapsed to one, but two have to stay unchanged.
> This has come up multiple times in the past.
>
A little more info, quoting from the Autoconf manual:
POSIX lets implementations treat leading // specially, but requires leading
/// and beyond to be equivalent to /. Most Unix variants treat // like /.
However, some treat // as a "super-root" that can provide access to files
that are not otherwise reachable from /. The super-root tradition began
with Apollo Domain/OS, which died out long ago, but unfortunately Cygwin
has revived it.
HTH,
Stefano