URL: https://linuxfr.org/forums/programmation-shell/posts/un-bug-dans-les-shell-mais-en-fait-non-linux-fuck-posix Title: Un bug dans les shell ?!!!! Mais en fait non (Linux fuck Posix) Authors: greendev Date: 2023年08月27日T16:50:23+02:00 License: CC By-SA Tags: Score: 7 Bonjour, ```> pwd /home/$USER/a> pwd -P /home/$USER/b ``` Pourtant : ```> man pwd ... If no option is specified, -P is assumed. ... ``` Essayé avec zsh, bash, dash. Tous les builtins sont ko. `/bin/pwd` est ko. Du coup je jette un œil dans la doc des shell. Il est indiqué à chaque fois : « si l’option -P est spécifiée alors... ». Oki doki, mais *what* si elle n’est pas spécifiée ? Les man sont silencieux. Pris d’un doute : ```> man 1p pwd ... If both -L and -P are specified, the last one shall apply. If neither -L nor -P is specified, the pwd utility shall behave as if -L had been specified. ... ``` Et oui, j’ai un petit `export POSIXLY_CORRECT=` planqué quelque part dans un profil. C’est la première fois que je tombe sur un cas concret de comportement totalement inversé entre Linux et Posix. La question existentielle du jour : mais POURQUOI ???