Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: Were is "cd //" documenmted ?

  1. #11
    Join Date
    Feb 2007

    Re: Were is "cd //" documenmted ?

    Quote Originally Posted by helen314
    Were is "cd //" documenmted ?
    man path_resolution
    Quote Originally Posted by helen314 View Post
    Anybody have suggestion how to ask Mrs Google or have a link to "DOS shorthand commands
    First of all it is BASH not DOS.
    I did a search for: 'unix slash vs double slash'
    and found this very interesting reading:

    Bash runs on nearly every version of Unix and a few other operating systems. According to the POSIX Pathname Resolution specification:
    A pathname consisting of a single slash shall resolve to the root directory of the process. A null pathname shall not be successfully resolved. A pathname that begins with two successive slashes may be interpreted in an implementation-defined manner, although more than two leading slashes shall be treated as a single slash.
    But yeh, on most OSes / and // are the same.

  2. #12
    Join Date
    Mar 2010

    Re: Were is "cd //" documenmted ?

    For all programmers, if you always use '/' as your directory separator, it works on all the popular OSes, including MS-Windows. Has for decades.

    Every shell I've used - probably all the popular ones, but not fish, handle // anywhere in the path as a single /.

    I suspect the confusion comes due to SMB, which likes \\server\path\to\something. However, if //server/path/to/something is used, that works. Whereas, \\server\path\to\something really must be entered as \\\\server\\path\\to\\something to be correct on a Unix system. On Unix, to get a single \ character, we have to escape it by using the escape character, which is almost always a single \.

    \\ --> \\\\

    It is just easier to use /, unless that doesn't work. But I can see where personal preference would see that as odd.

Page 2 of 2 FirstFirst 12


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts