Have been asked how to test if a command exists on the running system within a shell script.
Change 'prog_name' for the name of the program being tested for.
if ! [ -x "$(command -v prog_name)" ]
then
echo 'prog_name is not installed/available. Exiting...' >&2
exit 1
fi
Jun 4, 2019 · 1:46 AM UTC
