Re: sed usage (was: automated editing of text files)

2011-09-17 Thread Bob Proulx
Tom Furie wrote: > Bob Proulx wrote: > > Using sed is a good tool for this but if you want to append then you > > should use the 'a' command. > > > > $ printf "one\ntwo\nthree\nfour\n" | sed '/two/a\ > > -> foo' > > one > > two > > -> foo > > three > > four > > This doesn't quite wo

sed usage (was: automated editing of text files)

2011-09-17 Thread Tom Furie
On Fri, Sep 16, 2011 at 12:58:08PM -0600, Bob Proulx wrote: > Using sed is a good tool for this but if you want to append then you > should use the 'a' command. > > $ printf "one\ntwo\nthree\nfour\n" | sed '/two/a\ > -> foo' > one > two > -> foo > three > four This doesn't quite wor