#############################
Migrated to https://ubuntuincident.wordpress.com/2011/10/30/check-the-number-of-arguments-in-a-bash-script/.
Question
My script requires a parameter. How to check if it's passed?
Answer
# check for proper number of command line arguments
ERROR_PAR=65
if [ $# -ne 1 ]
then
echo "Usage: $0 <input_file>"
exit $ERROR_PAR
fi