Been looking around for this but haven't been able to find anything.
I'd like to be able to add a new line after matching text in a line.
For example, say I got:
Code:
#output databases: mysql, snort, password yourpassword, more, blah
and after this line I'd like to add:
Code:
#output databases: mysql, snort, password yourpassword, more, blah
darn right
So far I got:
Code:
sed -i -e 's`^#output database$`#out$ \
darn right`g' file
As you can see I'm at a loss as what the second value should be. I'd like to be able to match this generically. Is this possible? Also does the first value (^output database$) appear right?
Bookmarks