Skip to content

Instantly share code, notes, and snippets.

@amanuel2
Created December 27, 2016 19:02
Show Gist options
  • Select an option

  • Save amanuel2/714d95539a5cf713f2e7b4e569e23f02 to your computer and use it in GitHub Desktop.

Select an option

Save amanuel2/714d95539a5cf713f2e7b4e569e23f02 to your computer and use it in GitHub Desktop.
#/bin/sh
command_exists()
{
touch .temp.23 #tempFile
which $1 1> .temp.23
if grep "" .temp.23; then
echo COMMAND EXISTS
else
echo command DOSENT EXIST
rm -f .temp.23
fi
}
command_exists $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment