SED - replace line after substing
Hi,
How do I replace the line content after a particular string ? For example: If I have the below lines; ABCD 1234\00 EFGH 5678\00 How do I replace the line after "ABCD" string to be 1111. ABCD 1111\00 EFGH 5678\00 Please note that I don't know the line content after the string. |
Use the n command of sed to go to the next line, then apply the substitution:
Code:
sed '/ABCD/{n; s/.*\(\\00\)/1111\1/} file |
Thanks you very much !!!
It works
|
All times are GMT -5. The time now is 03:44 AM. |