lundi 4 avril 2016

Bash checking parameter value [duplicate]

This question already has an answer here:

I'm trying to implement an if clause that cheks as condition the value of a parameter. My code looks lke this:

!#/bin/sh
echo "test"
echo "$1"
if ["$1" = 10]
then
echo "test2"
fi

the output is "test 10"

Aucun commentaire:

Enregistrer un commentaire