- Verify is Supplied any argument
((!$#)) && echo No arguments supplied! && exit 1
- If you need to ensure a minimum ammount of args
if [ $# -ge 3 ]
then
echo script has at least 3 arguments
fi
In this case, if needed can use comparators
(-eq, -lt, -ge, etc.)
but only works for integer comparison For example:
if [[ $# -eq 0 ]] ; then
echo 'Must pass at least one argument'
exit 1
fi