Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

shell -eq

-eq is for numerical comparison and == is for string comparison
a=30
b=20
if [[ $a -eq $b ]]; then
    echo "Match"
else
    echo "No Match"
fi

Output:No Match
=================================================
a=John
b=George
if [[ $a -eq $b ]]; then
    echo "Match"
else
    echo "No Match"
fi

Output:Match
which is wrong
 
PREVIOUS NEXT
Tagged: #shell
ADD COMMENT
Topic
Name
6+1 =