Received: from spf3.us4.outblaze.com (spf3.us4.outblaze.com [205.158.62.25]) by sdf.lonestar.org (8.12.10/8.12.10) with ESMTP id iAA3Qr1G016580 for ; Wed, 10 Nov 2004 03:26:54 GMT Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by spf3.us4.outblaze.com (Postfix) with ESMTP id D22B053FF0 for ; Wed, 10 Nov 2004 03:26:53 +0000 (GMT) Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CRjGi-0008O7-FL for migo@homemail.com; Tue, 09 Nov 2004 22:35:36 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CRjGK-0008Ml-RV for gnu-arch-users@gnu.org; Tue, 09 Nov 2004 22:35:12 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CRjGK-0008M8-7R for gnu-arch-users@gnu.org; Tue, 09 Nov 2004 22:35:12 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CRjGK-0008Lq-0X for gnu-arch-users@gnu.org; Tue, 09 Nov 2004 22:35:12 -0500 Received: from [144.140.71.40] (helo=gizmo05ps.bigpond.com) by monty-python.gnu.org with smtp (Exim 4.34) id 1CRj7n-0004FL-4k for gnu-arch-users@gnu.org; Tue, 09 Nov 2004 22:26:23 -0500 Received: (qmail 20008 invoked from network); 10 Nov 2004 03:26:20 -0000 Received: from unknown (HELO psmam11.bigpond.com) (144.135.25.100) by gizmo05ps.bigpond.com with SMTP; 10 Nov 2004 03:26:20 -0000 Received: from cpe-144-132-221-212.nsw.bigpond.net.au ([144.132.221.212]) by psmam11.bigpond.com(MAM REL_3_4_2a 225/1480720) with SMTP id 1480720; Wed, 10 Nov 2004 13:26:20 +1000 Received: by poolcompsonline.com (Postfix, from userid 1000) id 4C2EE79641; Wed, 10 Nov 2004 14:29:06 +1100 Subject: Re: [Gnu-arch-users] new version hook script examples From: Zenaan Harkness To: arch In-Reply-To: <1096158785.25824.14.camel@whiskas.cashpoolcomps.com> References: <1096079213.3761.169.camel@whiskas.cashpoolcomps.com> <20040925174731.GB26602@stig.vm.bytemark.co.uk> <1096157610.25824.3.camel@whiskas.cashpoolcomps.com> <20040926002248.GA19343@suffields.me.uk> <1096158785.25824.14.camel@whiskas.cashpoolcomps.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1100057346.4185.135.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Wed, 10 Nov 2004 14:29:06 +1100 X-BeenThere: gnu-arch-users@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: a discussion list for all things arch-ish List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: gnu-arch-users-bounces+migo=homemail.com@gnu.org Errors-To: gnu-arch-users-bounces+migo=homemail.com@gnu.org Status: RO Content-Length: 1814 Lines: 53 On Sun, 2004-09-26 at 10:33, Zenaan Harkness wrote: > On Sun, 2004-09-26 at 10:22, Andrew Suffield wrote: > > On Sun, Sep 26, 2004 at 10:13:30AM +1000, Zenaan Harkness wrote: > > > On Sun, 2004-09-26 at 03:47, Stig Brautaset wrote: > > > > On Sat, Sep 25, 2004 at 12:26:54PM +1000, Zenaan Harkness wrote: > > > > > sed -e "s/$VERSION_SED_STRING/$RELEASE_DATE/" D.java > D.java > > > > > > > > I'm surprised if this works as you (seem to) expect. I worry that the > > > > redirection will nuke the content of the file before it is opened by > > > > sed. Either use (relatively) recent gnu sed with the -i flag or > > > > something like this: > > > > > > > > sed -e "s/$VERSION_SED_STRING/$RELEASE_DATE/" D.java > ,D.java && \ > > > > mv ,D.java D.java > > > > > > I was thinking that too you know ... but empirically, it works, > > > so I never bothered adding the redirection. > > > > It should never work. Something's wrong if it does. > > OK, you're right - I had two versions, one "embedded" which I was using > (and forgot about) as per: > > SRC_MUNGE_FILE=$SRC/cpc/D.java > DST_MUNGE_FILE=$DST/D.java > sed -e "s/cpc_Release_Version/$RELEASE_DATE/" $SRC_MUNGE_FILE > > $DST_MUNGE_FILE > > Sorry for confusing anyone, > Zen BTW, does anyone know/ use an alternative to perl -i for in-place munging? I guess I should learn how to chain multiple lines such as the following into one, since firing up perl for each line seems rather heavy weight. perl -pi -e "s#SUB_WEB_HOST#$SUB_WEB_HOST#g;" $SED_FILES perl -pi -e "s#SUB_server.host#$SUB_server_host#g;" $SED_FILES ... ?? tia zen _______________________________________________ Gnu-arch-users mailing list Gnu-arch-users@gnu.org http://lists.gnu.org/mailman/listinfo/gnu-arch-users GNU arch home page: http://savannah.gnu.org/projects/gnu-arch/