Skip to content

Instantly share code, notes, and snippets.

@benvium
Created September 30, 2014 15:49
Show Gist options
  • Select an option

  • Save benvium/390ef36d18d26eaef02b to your computer and use it in GitHub Desktop.

Select an option

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