I am trying to write a shell script which will grep for keywords which should be excluded from a file, if it finds anything else from excluded one, It should execute specific command..
logcheck=`grep -vq 'accepting\|idle.' /tmp/lpstat-Final.log` if [[ $logcheck == 'accepting\|idle.' ]] ; then status=0 statustxt=OK else echo "Something found" fi
The outcome should be If anything apart from 'accepting\|idle.' found it should go to else statement or else the exist status will be 0