Hi, hoping some scripting guru here can help me out.
I have a bash script that i wrote to replace every 6th line in a file but what i really want is for it to replace certain lines only and these lines with certain keywords arent always in the 6th line.
my original script:
------------
#!/bin/bash
for LIST in *
do
sed '6c\
2008022701 ; serial\
' $LIST > ../namedtmp/$LIST
done
--------------
in the file there are many line but i need to look for these lines
2006062901 ; serial
IN NS ns1.xxx.net.
IN NS ns2.xxx.net.
and replace them with
2008022701 ; serial
IN NS ns1.ZZZ.net.
IN NS ns2.ZZZ.net.
I would really appreciate your help.
I have a bash script that i wrote to replace every 6th line in a file but what i really want is for it to replace certain lines only and these lines with certain keywords arent always in the 6th line.
my original script:
------------
#!/bin/bash
for LIST in *
do
sed '6c\
2008022701 ; serial\
' $LIST > ../namedtmp/$LIST
done
--------------
in the file there are many line but i need to look for these lines
2006062901 ; serial
IN NS ns1.xxx.net.
IN NS ns2.xxx.net.
and replace them with
2008022701 ; serial
IN NS ns1.ZZZ.net.
IN NS ns2.ZZZ.net.
I would really appreciate your help.