Skip to content

Instantly share code, notes, and snippets.

@nazfox
Created January 30, 2022 00:29
Show Gist options
  • Save nazfox/6fb94dff1ee6d182f994e3a53f49bb5b to your computer and use it in GitHub Desktop.
Save nazfox/6fb94dff1ee6d182f994e3a53f49bb5b to your computer and use it in GitHub Desktop.
#!/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