jeudi 27 août 2015

Bash or condition in IF

Why does the OR condition not work in the following bash script?

read number

if [ "$number" != 1 -o "$number" != 2 ] ; then echo not 1 or 2 fi

if [ "$number" == 1 -o "$number" == 2] ; then echo 1 or 2 fi

exit

Aucun commentaire:

Enregistrer un commentaire