bash if argument given code example
Example 1: if argument bash
if [ -z "$1" ]
then
echo "No argument supplied"
fi
if ["$1" ]
then
echo "Argument supplied is: "$1
fi
Example 2: bash if argument in file
if [ ! -z $1 ] #Check if argument for script is given
then var=$1
else var="argument_not_given"
fi