jeudi 29 janvier 2015

Why is this bash IF statement not working?


if [[ $DATA == *?xml* ]]
then
if [[ $DATA == *misuse* ]]
then echo "Misuse" >> $OUTPUTPAST2
else echo "All Good" >> $OUTPUTPAST2
fi
else echo "Not xml" >> $OUTPUTPAST2
fi


Where $DATA does not contain the string ?xmlI am expecting an output of Not xml, but I am getting output of All Good.


What am I doing wrong?


Aucun commentaire:

Enregistrer un commentaire