A message for Linux.com registered users: We are in the process of making changes to the Linux forums. Starting Monday, 8/13/18 at 6:00 PM PT, you will be unable to access the forums. They will re-launch as soon as possible on Wednesday, 8/15/18 with new features and improved functionality. Thank you for your patience and stay tuned for the new improved forums.
Flow control based on grep match pattern or string
Looking to create a flow control based on a string or pattern matched in a log file.
The log file may contain either of these
safafaf sdfaasfsa CONFSUCCESS
adsfasdfadsfadsf fafasfasdfasdf fafasfafsa
sadfafasfasdfadss fdsafadff fasfadfaf asff
So idea is to grep the message from log, based on pattern run a flow control as below.
1 Look in System.log - CONFSUCCESS - show message as - SUCCESSFUL - Ask user to - Press ENTER to continue
2 Look in System.log - CONFFAIL - show message as - FAILURE - Exit (come out of shell)
3 Look in System.log - CONFPARTIAL - Show message as - PARTIALSUCCESS - Exit (come out of shell)