Skip to content

Instantly share code, notes, and snippets.

@maasha
Last active December 12, 2015 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maasha/4682930 to your computer and use it in GitHub Desktop.
Save maasha/4682930 to your computer and use it in GitHub Desktop.
#!/bin/bash
function run()
{
cmd=$1
if error=$($cmd); then
echo "OK"
else
echo "FAIL"
echo " $error"
fi
}
cmd="ls -al"
run $cmd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment