我注意到在bash / zsh中如果我cd //它将我放在一个名为’//’的目录中 – pwd显示了我的提示.
如果我使用两个以上的斜杠,比如cd ///等,它只会让我进入/.
bash中的目录是否有意义?
POSIX标准告诉//可能由符合操作系统的特定方式解释,而///等同于/:
原文链接:https://www.f2er.com/bash/383593.htmlhttp://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_12
If a pathname begins with two successive characters,the first component following the leading characters may be interpreted in an implementation-defined manner,although more than two leading characters shall be treated as a single character.
这就是为什么bash保持不变的原因,以防底层操作系统实现这种特殊含义.