Bash -eq and ==, what's the diff?

后端 未结 3 1355
情话喂你
情话喂你 2021-01-23 00:31

Why this works:

Output=$( tail --lines=1 $fileDiProva )
##[INFO]Output = \"OK\"

if [[ $Output == $OK ]]; then
    echo \"OK\"
else
    echo \"No Match\"
fi
         


        
3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-23 01:03

    -eq, -lt, -gt is only used for arithmetic value comparison(integers).

    == is used for string comparison.

提交回复
热议问题