[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sed newlines

Hi all,
     I'm trying to use a sed one-liner to edit a file in-place
(squid.conf).  Using Fedora Core 3, the following line works just

sed -i '/# cache_effective_user/a cache_effective_user
squid\ncache_effective_group squid' /etc/squid/squid.conf

On a Fedora Core 2 box, though (with sed 4.0.8), the newlines do not
get interpreted, and all the lines run together, instead of giving me
2 new lines, I get 1.

I've tried different options and google searches, to no avail.

Does anyone know how to do this with sed where "\n" doesn't work? 
Optionally, perl will also work fine for me, but I need to append
after regex'ing a line, and all I've found in perl one-liners is
replacing text.

Thanks in advance,

Gary Smithe

To unsubscribe, send email to majordomo@silug.org with
"unsubscribe silug-discuss" in the body.