Hello all,
I have many text files I need to add a line at a certain point. A sample of the file is below:
What I need to do is insert a line with "NOTIFICATION" in it just below each "SET" as in:
If at first you don't succeed, don't try skydiving.
I have many text files I need to add a line at a certain point. A sample of the file is below:
Code:
SYNTAX_VERSION 7
LOGFILE "ADSM/AIX logs"
DESCRIPTION "ADSM backup message log on AIX"
LOGPATH "/usr/lpp/adsm/bin/dsmsched.log"
INTERVAL "15m"
CHSET ISO88591
FROM_LAST_POS
CLOSE_AFTER_READ
SEVERITY Unknown
APPLICATION "ADSM"
MSGGRP "Unix_Support"
MSGCONDITIONS
DESCRIPTION "password expired"
CONDITION_ID "aad654f8-ec52-71d7-1fca-aa0615200000"
CONDITION
TEXT "Your password has expired."
SET
SEVERITY Critical
TEXT "The ADSM client password has expired!"
HELPTEXT "The password for the client portion of the ADSM
Backup Software has expired. This system will not
be able to backup to the mainframe until this is
corrected.
Contact the HPUX oncall person during the day or
leave a phonemail for them."
HELP "6fa76d9da5b2.02.80.01.11.2c.00.00.00"
DESCRIPTION "info: number of bytes transferred"
CONDITION_ID "aaeee202-ec52-71d7-1fca-aa0615200000"
CONDITION
TEXT "<@.date> <@.time> Total number of bytes transferred: <*.bytes>"
SET
SEVERITY Normal
TEXT "Successful backup: <bytes> bytes on <date> at <time>"
DESCRIPTION "info: data transfer rate"
CONDITION_ID "aaf50bf0-ec52-71d7-1fca-aa0615200000"
CONDITION
TEXT "Data transfer rate: <*.rate>"
SET
SEVERITY Normal
TEXT "Successful backup: data transfer rate <rate>"
DESCRIPTION "info: compression"
CONDITION_ID "aaf93d24-ec52-71d7-1fca-aa0615200000"
CONDITION
TEXT "Compression percent reduction: <*.compress>"
SET
SEVERITY Normal
TEXT "Successful backup: <compress> compression reduction"
What I need to do is insert a line with "NOTIFICATION" in it just below each "SET" as in:
Code:
SYNTAX_VERSION 7
LOGFILE "ADSM/AIX logs"
DESCRIPTION "ADSM backup message log on AIX"
LOGPATH "/usr/lpp/adsm/bin/dsmsched.log"
INTERVAL "15m"
CHSET ISO88591
FROM_LAST_POS
CLOSE_AFTER_READ
SEVERITY Unknown
APPLICATION "ADSM"
MSGGRP "Unix_Support"
MSGCONDITIONS
DESCRIPTION "password expired"
CONDITION_ID "aad654f8-ec52-71d7-1fca-aa0615200000"
CONDITION
TEXT "Your password has expired."
SET
[b]NOTIFICATION[/b]
SEVERITY Critical
TEXT "The ADSM client password has expired!"
HELPTEXT "The password for the client portion of the ADSM
Backup Software has expired. This system will not
be able to backup to the mainframe until this is
corrected.
Contact the HPUX oncall person during the day or
leave a phonemail for them."
HELP "6fa76d9da5b2.02.80.01.11.2c.00.00.00"
DESCRIPTION "info: number of bytes transferred"
CONDITION_ID "aaeee202-ec52-71d7-1fca-aa0615200000"
CONDITION
TEXT "<@.date> <@.time> Total number of bytes transferred: <*.bytes>"
SET
[b]NOTIFICATION[/b]
SEVERITY Normal
TEXT "Successful backup: <bytes> bytes on <date> at <time>"
DESCRIPTION "info: data transfer rate"
CONDITION_ID "aaf50bf0-ec52-71d7-1fca-aa0615200000"
CONDITION
TEXT "Data transfer rate: <*.rate>"
SET
[b]NOTIFICATION[/b]
SEVERITY Normal
TEXT "Successful backup: data transfer rate <rate>"
DESCRIPTION "info: compression"
CONDITION_ID "aaf93d24-ec52-71d7-1fca-aa0615200000"
CONDITION
TEXT "Compression percent reduction: <*.compress>"
SET
[b]NOTIFICATION[/b]
SEVERITY Normal
TEXT "Successful backup: <compress> compression reduction"
If at first you don't succeed, don't try skydiving.