exampe1:
cd ${PATH}
if [ 'grep SOME_STRING $PATH/$LOGFILE' ]
then
rm ${FILE}
./anotherScript
else
exit 1
fi
exit 1
Example 2:
cd ${PATH}
if [ $(grep -c SOME_STRING $PATH/$LOGFILE) -ne 0 ]
then
rm ${FILE}
./anotherScript
else
exit 1
fi
exit 0
Exampe 3:
cd ${PATH}
grep -q SOME_STRING $PATH/$LOGFILE
if [ $? -eq 0 ]
then
rm ${FILE}
./anotherScript
else
exit 1
fi
exit 0
沒有留言:
張貼留言