samedi 28 février 2015

Frustraiting How are there too many arguments in this if statement


if [ $? -ne 0 ]; then
STATUS=$(cat $LOG.$i)
if [ $STATUS != "$i-DOWN!" ]; then
echo "$(date): ping failed, $i host is down!" |
mail -s "$(date) $i host is down!" $EMAIL
fi
echo "$(date) $i-DOWN!" > $LOG.$i
else
STATUS=$(cat $LOG.$i)
**------->>>**if [ $STATUS != "$i-UP!" ]; then
echo "$(date): ping OK, $i host is up!" |
mail -s "$(date) $i host is up!" $EMAIL
fi
echo "$(date) $i-UP!" > $LOG.$i
fi


I keep getting the error "Too many arguments" for that specific line with teh arrow pointing to it.. but I have the exact same line above it and do not get the error...


This is frustrating anyone have any idea why?


Aucun commentaire:

Enregistrer un commentaire