2 ms·
More realistically, it also fails if you have directories on your path that are symlinks to other directories in the path. In that case their programs are doub
by enriquto 6y ago
More realistically, it also fails if you have directories on your path that are symlinks to other directories in the path. In that case their programs are doubly-counted.
Anyways, if your PATH is malicious then you have worse problems than this silly script :)
- JdeBP 6y agoYour error is in thinking that either of those cases is in any way malice.
- junke 6y agoI agree, but "more realistically"? those cases were pretty realistic I think. If you run the script on a box where you have users who can do whatever they want, at least the script should fail on bad inputs. PATH=rm -rf :/bin