Je t'invite à consulter l'excellentissime "Advanced bash scripting guide", qui dit, chapitre 8.1 :
# = as a test operator
if [ "$string1" = "$string2" ]
# if [ "X$string1" = "X$string2" ] is safer,
# to prevent an error message should one of the variables be empty.
# (The prepended "X" characters cancel out.)
then
command
fi
[^] # Re: File
Posté par Volnai . En réponse au message [Bash] Detecter des fichiers de taille nulle. Évalué à 5.
# = as a test operator
if [ "$string1" = "$string2" ]
# if [ "X$string1" = "X$string2" ] is safer,
# to prevent an error message should one of the variables be empty.
# (The prepended "X" characters cancel out.)
then
command
fi
http://www.tldp.org/LDP/abs/html/ops.html(...)