Created
September 30, 2014 15:49
-
-
Save benvium/390ef36d18d26eaef02b to your computer and use it in GitHub Desktop.
bash command line parameters and usage help
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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