Am learning linux, so when i tried to execute the if script, but am getting the error saying that “unexpected error”
num=$5
if [ $num -gt 10 ]
then
echo "greater than 10"
else
echo “lesser than 10”
fi
Its displaying output as :
:~# sh if.sh 11
if.sh: 4: [: -gt: unexpected operator
lesser than 10
Could anyone please help me with this issue?
//Thanks
New contributor
Srii Chandana is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.