$ command -v foo >/dev/null 2>&1 || {
echo >&2 "I require foo but it's not installed. Aborting."; exit 1;
}
OR
$ type foo >/dev/null 2>&1 || {
echo >&2 "I require foo but it's not installed. Aborting."; exit 1;
}
OR
$ hash foo 2>/dev/null || {
echo >&2 "I require foo but it's not installed. Aborting."; exit 1;
}
No comments:
Post a Comment