Created
January 30, 2022 00:29
-
-
Save nazfox/6fb94dff1ee6d182f994e3a53f49bb5b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
command=$1 | |
additional_message=$2 | |
message="Can't find $command." | |
if [ -n "$additional_message" ]; then | |
message="$message $additional_message" | |
fi | |
type $command > /dev/null 2>&1 || (echo "$message" 1>&2; exit 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment