cd into // works?
Julian H. Stacey
jhs at berklix.org
Wed Feb 23 13:36:02 GMT 2005
Chet Ramey wrote:
> > >due to a typo, I typed
> > >
> > >[klamath] ~>cd //
> > >
> > >today. Okay, I'm used to the shell[1] changing any // into /, so I
> > >expected to get to /. Now, I got there, but pwd/$PWD still have "//" in
> > >them?
>
> This is from the bash FAQ:
>
> 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'.
I recall PCS Cadmus supported eg /../other_hostname/usr/other_person (on
Unix Graphics workstations with proprietary networking extension).
-
Julian Stacey Net & Sys Eng Consultant, Munich http://berklix.com
Mail in Ascii (Html=Spam). Ihr Rauch = mein allergischer Kopfschmerz.
More information about the freebsd-current
mailing list