I want to check if the user has given the script any arguments and if this is the case, the script should close.
if [ $@ = "" ]; then
exit
fi
is not working.
I want to check if the user has given the script any arguments and if this is the case, the script should close.
if [ $@ = "" ]; then
exit
fi
is not working.
You can try like this,
if [ "$#" -eq 0 ]; then
echo "Illegal number of parameters"
fi