I'm trying to compile this code but I am getting the following error:
Q2.sh: line 18: syntax error near unexpected token `fi'
Q2.sh: line 18: `fi'
at line 15, I'm trying to verify if the parameter numero
is bigger than 0. Any help is appreciated
Thanks
#!bin/bash
numero=$1
if test $# -eq 0; then
echo "Argument Manquants"
exit 1
fi
if ! [[ "$numero" =~ ^[0-9]+$ ]] ; then
exec >&2; echo "Le parametre doit etre un digit";
exit 1
fi
if [ $numero -le 0 ]
$$ echo "Le parametre doit etre plus grand que 0"
exit 1
fi
cat /etc/passwd grep "$numero"