14

awk with exit status if pattern not found

view full story
linux-howto

http://www.unix.com – Hi everyone, Looking at writing another awk program here to find a pattern on a text file. If patterns aren't found I want the awk program to exit and then bash to file a failure log on the local machine. Then later a management framework we have in place will read if that failure log file exists and flag the computer as being failed in our database. I am pretty good with my bash skills but awk and sed still hang me up from time to time and I cannot wrap my head around this one so figure I'd ask the gurus here, as I am probably just being an idiot on how this works. Here is an example: (HowTos)