7
votes
3answers
2k views

How can I instruct BSD sed to interpret escape sequences like \n and \t?

I have a sed replacement command that I would like to be compatible with BSD sed as well as GNU sed. Extended regular expressions are not an issue as I do not need them in this case. My primary ...
1
vote
1answer
902 views

Insert after a second pattern in sed

I'm using sed to edit a text file. The command: sed -n -e '/pattern1/,/pattern2/p' test01.txt show the lines between pattern1 and pattern2. But how can I insert a new line after this pattern2? my ...