I am trying to do a one time check about apache's mod-status page for updates like this(this is just a test script):
firstcontent=$(lynx -dump http://some-server/server-status-page)
echo $firstcontent > /tmp/myfirstcontentfiles.txt
nextcontent=$(lynx -dump http://some-server/server-status-page)
prevcontent=`cat /tmp/myfirstcontentfiles.txt`
#this always returns false, but their contents are same
if [ "$prevcontent" == "$firstcontent" ]; then echo "match"; fi
#but this returns true
if [ "$nextcontent" == "$firstcontent" ]; then echo "match"; fi
My question is why $prevcontent and $firstcontent comparision returns false whilst I am supposed to get a true return value? is anything happening behind the scene when I am saving it in a file?
difffor comparing the two files. – steviethecat Dec 24 '14 at 22:44