On Feb 18, 2012, at 8:13 AM, Rich Shepard wrote:

> /home/rshepard/shell-scripts/ngetip.sh: line 4: [: !=: unary operator expected
> 
>   Here are the first few lines of the script:
> 
> #!/bin/bash
> OLDIP=$(cat /home/rshepard/CURRENTIP)
> NEWIP=$(curl -s http://automation.whatismyip.com/n09230945.asp) 
> if [ $NEWIP != $OLDIP ];  then
>     echo $OLDIP
>     echo $NEWIP

In my experience, this usually means one of the variables wasn't set. 

Assuming the /home/rshepard/CURRENTIP file exists, then I would assume curl was 
unable to connect to the URL given. This would cause $NEWIP to not be set, and 
the test condition to fail.

Russell Johnson
[email protected]



_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to