mercredi 6 avril 2016

Mulitple compare conditions in a if statement in bash

I want to put multiple compare conditions in a if statement using "or" operator Here is the snippet.,

    if [[ "$input" == "string1" ] || [ "$input" == "string2" ] || [ "$input" == "string3" ]]; then
    ...
   fi

But when I execute the command, it fails saying syntax error near unexpected token `]'.

Could you guys please help?

Aucun commentaire:

Enregistrer un commentaire