Skip to content

Instantly share code, notes, and snippets.

@benvium
Created September 30, 2014 15:49
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 benvium/390ef36d18d26eaef02b to your computer and use it in GitHub Desktop.
Save benvium/390ef36d18d26eaef02b to your computer and use it in GitHub Desktop.
bash command line parameters and usage help
#!/bin/sh
if [ $# -ne 2 ]; then
echo "Usage: $0 (first parameter) (second parameter) e.g. $0 foo bar";
exit 1;
fi
foo=$1
bar=$2
echo "$foo $bar"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment