Re:Stupid Unix Tricks
by Fnoord on Friday October 18, 2019 @05:19AM
(#21289830)
In config.fish I use type for this purpose, together with the exit code
[ Parent
| on HN ]
type -p also works in bash/zsh
Fish as well, but the redirection of both stdout and stderr is different:
type -p brew >/dev/null ^&1; and brew
in Bash it would be: type -p brew &>/dev/null && brew
Using test avoids caring about stdout/stderr.