bash check how many arguments code example
Example 1: bash count number of arguments
The number of arguments is $#
Example 2: bash command check 2 arguments
if [ $# -lt 2 ]; then
# TODO: print usage
exit 1
fi
The number of arguments is $#
if [ $# -lt 2 ]; then
# TODO: print usage
exit 1
fi