How to handle missing args in shell script
Typical shell scripts begin by parsing the options and arguments passed on the command line. The number of arguments is stored in the # parameter, i.e., you get it with $#. For example, if your scripts requires exactly three arguments, you can do something like this: if [ $# -lt 3 ]; then echo 1>&2 … Read more