I am writing a wee script to get an ip and compare to an existing file - the results of the 2 cat commands are identical but no matter what the files contain it will always treat this as false....If both files have exactly the same it will never print Hello, same if both are different.....heellpp!!
#!/bin/sh
#
# Get external IP address #
/usr/bin/wget
http://www.xxxx/ip.php
result1=$(cat ip.php)
result2=$(cat ip.old)
echo $result1
echo $result2
if [ '$result1' = '$result2' ]; then
echo "hello"
fi
mv ip.php ip.old