4 ms·
As I mentioned elsewhere (https://news.ycombinator.com/item?id=6210440 https://news.ycombinator.com/item?id=6210440), it's just wrong to use "which" in general.
by cbsmith 13y ago
As I mentioned elsewhere (https://news.ycombinator.com/item?id=6210440 https://news.ycombinator.com/item?id=6210440), it's just wrong to use "which" in general.
- wazari972 13y agoIndeed, which does not recognize aliases and functions, so `command -v` seems better: command -v llh >/dev/null 2>&1 ; echo $? 0 # good usr/bin/which llh >/dev/null 2>&1 ; echo $? 1 # good however (zsh) shell internal which does: which llh ; echo $? llh='ls -lh' /usr/bin/ls 0 #good (I'm not sure however when ZSH chooses to use its internal function or the one from $PATH)