From owner-freebsd-questions@FreeBSD.ORG Tue Jun 19 07:54:16 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0AAF016A4D4 for ; Tue, 19 Jun 2007 07:54:15 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 53F3313C458 for ; Tue, 19 Jun 2007 07:54:15 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (vader.bytemobile.ondsl.gr [83.235.244.135]) (authenticated bits=128) by igloo.linux.gr (8.13.8/8.13.8/Debian-3) with ESMTP id l5J7rptK002059 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 19 Jun 2007 10:53:58 +0300 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.1/8.14.1) with ESMTP id l5J7rS6J001917; Tue, 19 Jun 2007 10:53:45 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.1/8.14.1/Submit) id l5IIqn0D002378; Mon, 18 Jun 2007 21:52:49 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Mon, 18 Jun 2007 21:52:48 +0300 From: Giorgos Keramidas To: Olivier Regnier Message-ID: <20070618185248.GC2196@kobe.laptop> References: <467269EE.6090001@oregnier.net> <467284F9.7090005@oregnier.net> <4673E72A.3050706@oregnier.net> <200706181228.41947.nvass@teledomenet.gr> <4676516B.9010001@oregnier.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4676516B.9010001@oregnier.net> X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-2.545, required 5, ALL_TRUSTED -1.80, AWL -0.56, BAYES_40 -0.18) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: freebsd-questions@freebsd.org, Nikos Vassiliadis Subject: Re: problem with sed command and csh X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2007 07:54:16 -0000 On 2007-06-18 11:33, Olivier Regnier 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