1

Inserting a line beginning with regex

view story
linux-howto

http://www.unix.com – I have been trying to insert a line after a regex but I can't do it. Here is the code I am using: Code: cat saved_doc SET type = type1 SET type = STORE = y /vol/san_e1 /vol/san_5 /vol/san_e9 /vol/san_e11 /vol/san_e12 /vol/san_e13 /vol/san_e14 /vol/san_e16 /vol/san_e17 /vol/san_e18 /vol/san_e19 /vol/san_e20 /vol/san_e23 /vol/san_e24 /vol/san_e26 /vol/san_e27 /vol/san_e28 What I have done is this: Code: cat saved_doc |gawk '{printf "NEW\n"; print}' This makes the file look good except that I want NEW to be inserted starting after the line SET type = STORE = y only. Th (HowTos)