gnu-arch-users
[Top][All Lists]
Advanced

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

Re: [Gnu-arch-users] new version hook script examples


From: Zenaan Harkness
Subject: Re: [Gnu-arch-users] new version hook script examples
Date: Sun, 26 Sep 2004 10:33:05 +1000

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]