I\'ve been trying to compare whether two numbers in Bash are equal (and print a message if they are equal), but I\'m getting some strange error messages for this simple prog
For the first error message, remove the dollar sign $ and no spaces are allowed around the equal sign =
$
=
x=3
For the second error message, insert a space and a dollar sign $ before x and a space after 3
x
3
if [ $x -eq 3 ]
As @loentar correctly pointed out, it must be -eq and neither = nor ==.
-eq
==