On 02/18/2012 08:13 AM, Rich Shepard wrote: > This morning my inbox contained a message from root generated when the > hourly cron job ran at 4:00am: > > /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 > > This script has run for the past week plus without generating any errors. > Looking in my ORA bash shell book the syntax for an if statement (using > brackets to deliniate the if condition) seems correct. What might have > caused this message to be generated? > > Rich > > _______________________________________________ > PLUG mailing list > [email protected] > http://lists.pdxlinux.org/mailman/listinfo/plug
The expression returning $NEWIP failed. -- ~~R _______________________________________________ PLUG mailing list [email protected] http://lists.pdxlinux.org/mailman/listinfo/plug
