Date: Mon, 18 Jun 2007 21:52:48 +0300 From: Giorgos Keramidas <keramida@ceid.upatras.gr> To: Olivier Regnier <oregnier@oregnier.net> Cc: freebsd-questions@freebsd.org, Nikos Vassiliadis <nvass@teledomenet.gr> Subject: Re: problem with sed command and csh Message-ID: <20070618185248.GC2196@kobe.laptop> In-Reply-To: <4676516B.9010001@oregnier.net> References: <467269EE.6090001@oregnier.net> <467284F9.7090005@oregnier.net> <4673E72A.3050706@oregnier.net> <200706181228.41947.nvass@teledomenet.gr> <4676516B.9010001@oregnier.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2007-06-18 11:33, Olivier Regnier <oregnier@oregnier.net> wrote: > I founded solution with awk command and that works well. > > cat /usr/local/etc/pkgtools.conf | awk '{ sub(/^[ \t]*MAKE_ARGS = {/, > "&\n\t\x27ports-mgmtp/portupgrade\x27 => > \x27WITH_BDB4=1\x27,\n\t\x27sysutils/fastest_csvsup\x27 => > \x27WITH_ROUNDTRIP=1\x27,\n\t\x27mail/nbsmtp\x27 => \x27WITH_IPV6=1 > WITH_SSL=1\x27,\n"); print; }' > /usr/local/etc/pkgtools.conf I'm sure you really do *NOT* want to read and write to the same file in a single shell pipeline. Watch out for the cookie monster which feeds on the remains of zeroed out files :-P
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070618185248.GC2196>