#!/usr/local/bin/gawk -f # # filter.awk - written by Kevin P. Inscoe (Monitor Gateway System) # # History: # # When Who What # ---- --- ---- # 9-24-98 Kevin Inscoe Create Original # ############################################################### # # Global Variables # BEGIN { if (ARGC == 1) { print "Usage: cat message | gawk -f filter.awk" ; exit }} # # process input and parse out fields # /^From: / { if (!from) from = $2 } # set the from for replies /^Subject: / { if (!subj) subj = $2 } # set the severity from the subject lineprint $2 # # read up current position +1-10 for remaining data # # # If the parsed fields are blank then abort and try to reply. If we # have good values then continue and read-up the message body. # # line 1 - ITO message (<= 60 chars.) # line 2 - either SYS or APP (message group) # line 3 through end of message (alpha or email message text) # # End of job # END { print $from, $subj }