jeudi 14 mai 2015

IF statement not working in RH 6 (workd in RH 5)

I have a simple if statement that works fine in RH 5, but for some inexplicable reason, fails in RH 6:

if [[ ! $1 =~ "(one|two|three)" ]] ; then
    echo -e "\n***Invalid number"
    usage
    exit 1
else
    action=$1
fi  

I can use a case statement which works fine or re-write it but more than anything, I'm curious as to what has changed, assuming it is the version of RH and not something else?

Aucun commentaire:

Enregistrer un commentaire