@feld does that mean I can set a dangerous setup (PATH=".:$PATH" ; ln -s /bin/rm ls), `which ls` would report /bin/ls but `ls` would actualy run the rm command ?
Or is PATH also ignored by the shell. I mean any shell you can choose to use?
At least, they do not respect a "shall" from
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/env.html
« ENVIRONMENT VARIABLES The following environment variables shall affect the execution of env: […] PATH Determine the location of the utility »
Weird.