I just wanted to do a really simple comparison between 2 strings in Bash :
stat=`curl -Is $url | head -n 1` echo $stat if [ \"$stat\" = \"HTTP/1.1 200 OK\" ];th
The curl output includes a CR at the end of the lines, you need to remove it.
CR
stat=`curl -Is $url | head -n 1 | tr -d '\r'`