I've tried the suggestion at How do I compare two string variables in an 'if' statement in Bash?
but it's not working for me.
I have
if [ "$line" == "HTTP/1.1 405 Method Not Allowed" ]
then
<do whatever I need here>
else
<do something else>
fi
No matter what, it always goes to else statement. I am even echoing $line ahead of this, and then copied and pasted the result, just to be sure the string was right.
Any help on why this is happening would be greatly appreciated.