Friday, May 29, 2009

Insert text before a pattern with sed

cat some_file | sed '/pattern/i\
text to insert
' > output_file

No comments:

Post a Comment