C'est un comportement acceptable pour un shell conforme au standard POSIX.
- / et /// sont équivalents et représentent bien la racine de l'arborescence de fichiers.
- // éventuellement suivi d'un nom est "spécial" et son interprétation est libre suivant le système d'exploitation, bash et ash préservent donc ce nom de répertoire tel quel. D'autres shells comme ksh ou zsh ne préservent pas ce double slash, probablement car ils "savent" qu'il n'y a pas d'interprétation particulière à faire sur l'OS courant.
Référence: http://pubs.opengroup.org/onlinepubs...html#tag_04_12
A pathname consisting of a single <slash> shall resolve to the root directory of the process. A null pathname shall not be successfully resolved. If a pathname begins with two successive <slash> characters, the first component following the leading <slash> characters may be interpreted in an implementation-defined manner, although more than two leading <slash> characters shall be treated as a single <slash> character.
Partager