angelshark
MIS
Hello,
I’m writing a script that reads the /var/adm/messages file and split its space delimited fields into variables for later processing.
Though most messages in the file are single lined, there are a few that use multiple lines like in the following example:
May 11 17:20:59 myserver unix: WARNING: /pci@6,4000/scsi@3/sd@0,0 (sd75):
May 11 17:20:59 myserver unix: Error for Command: read Error Level: Fatal
May 11 17:20:59 myserver unix: Requested Block: 17 Error Block: 17
May 11 17:20:59 myserver unix: Vendor: SEAGATE Serial Number: 9751U84015
May 11 17:20:59 myserver unix: Sense Key: Media Error
May 11 17:20:59 myserver unix: ASC: 0x14 (<vendor unique code 0x14>), ASCQ: 0x1, FRU: 0x1
How can I concatenate the messages that come after « unix: » from all lines in case the message « WARNING: /pci@ » occurs?
Thanks for all your help.
I’m writing a script that reads the /var/adm/messages file and split its space delimited fields into variables for later processing.
Though most messages in the file are single lined, there are a few that use multiple lines like in the following example:
May 11 17:20:59 myserver unix: WARNING: /pci@6,4000/scsi@3/sd@0,0 (sd75):
May 11 17:20:59 myserver unix: Error for Command: read Error Level: Fatal
May 11 17:20:59 myserver unix: Requested Block: 17 Error Block: 17
May 11 17:20:59 myserver unix: Vendor: SEAGATE Serial Number: 9751U84015
May 11 17:20:59 myserver unix: Sense Key: Media Error
May 11 17:20:59 myserver unix: ASC: 0x14 (<vendor unique code 0x14>), ASCQ: 0x1, FRU: 0x1
How can I concatenate the messages that come after « unix: » from all lines in case the message « WARNING: /pci@ » occurs?
Thanks for all your help.