Here's a simple line from a bigger piece of code which is what I am confused about.
if [ $some_line == "text" ] then
Then I went on to use the same code for another program that I was working on but the code didn't work UNLESS I changed "==" to "=". I've gone through a few threads here that suggests both of them act the same way so it doesn't matter if you use single or double equals.
if [ $some_line = "text" ] then
So the first piece of code works on server1 but doesn't on server2 UNLESS I change it to "single equals". Both the servers have exactly the same environment.
Can anyone explain? Thanks!
EDIT - I am running the script as "bash myscript.sh" everytime.