Skip to content

Linux commands

Check if a command exists

bash
if [[ ! -x "$(command -v $CMD)" ]]; then
	echo "$CMD could not be found"
	exit
fi
if [[ ! -x "$(command -v $CMD)" ]]; then
	echo "$CMD could not be found"
	exit
fi