Sed in FreeBSD

James Bailie jimmy at mammothcheese.ca
Sat Jul 5 15:23:39 UTC 2008


Sebastian Tymków wrote:

> I've tried with sed -e '/PATTERN/ a\ line' file but this did'n work. There
> are many axamples in internet but none
> of them work on FreeBSD.

The inserted line needs to be on a separate physical line.

sed -e '/PATTERN/a\
line'

For /bin/csh, you need two backslashes because the shell recognizes
backslashes inside single-quotes, which it shouldn't.

-- 
James Bailie <jimmy at mammothcheese.ca>
http://www.mammothcheese.ca


More information about the freebsd-questions mailing list