Like this!
Is that cool, or what?
Via the always helpful stackoverflow.
#! /bin/bash
command_validate() {
command -v ${1} >/dev/null 2>&1 || { echo " WARNING: I require ${1} but it's not installed. Aborting." >&2; exit 1; }
}
command_validate passwd
exit 0
Is that cool, or what?
Via the always helpful stackoverflow.