Re: bug in cd

2017-07-19 Thread Bob Proulx
Kae Verens wrote:
> but, if you do this:
> cd // ; pwd
> 
> then the CLI reports
> //

Using two "//" at the start of a path name is special because in some
systems it means the path component that follows is a hostname.
Therefore it must be preserved verbatim.

Bob



Re: bug in cd

2017-07-14 Thread Chet Ramey
On 7/14/17 7:14 AM, Kae Verens wrote:
> I'm not even sure if cd is part of Bash?

It is. It's a regular shell builtin.

> anyway - if you type any of the following:
> cd / ; pwd
> cd /// ; pwd
> cd  ; pwd
> 
> the CLI always reports
> /
> 
> but, if you do this:
> cd // ; pwd
> 
> then the CLI reports
> //

Posix requires this behavior:

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/cd.html#tag_20_14

step 8c.

Two leading slashes must be preserved, because // has implementation-
defined semantics. Any other number may be collapsed to one slash.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/



bug in cd

2017-07-14 Thread Kae Verens
I'm not even sure if cd is part of Bash?

anyway - if you type any of the following:
cd / ; pwd
cd /// ; pwd
cd  ; pwd

the CLI always reports
/

but, if you do this:
cd // ; pwd

then the CLI reports
//

-- 
Kae Verens
http://kvsites.ie/