Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
lloeki
on Oct 19, 2019
|
parent
|
context
|
favorite
| on:
Stupid Unix Tricks
type -p also works in bash/zsh
Fnoord
on Oct 19, 2019
[–]
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.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: