Você deve deixar espaços entre os operandos dentro dos colchetes de teste [].
#!/bin/bash
#if ip address changes do
x=$(curl -4 icanhazip.com )
y=$(cat ./oldIP.txt )
if [ "$x" != "$y" ]
then
echo "Current IP Address is $x"
echo "Previous IP address is $y"
# y=$x
else
echo "The IP addresses are the same"
fi
#send email to me