I am trying to learn shell scripting and following the tutorials on tutorialspoint when I came across this problem with arithmetic comparison.
$VAL1=10
$VAL2=20
$VAL3=10
if [ $VAL1 == $VAL2 ]
then
echo "equal"
else
echo "not equal"
fi
but I got a [: ==: unexpected operator I am not sure why the comparison operator did not work. I know I can also use rational operators, but I want to know why '==' is not defined.
==inside of(( ... == ... ))tests (which I also believe are OK in bash). Good luck.