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
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