[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] mktemp ?
From: |
Aharon Robbins |
Subject: |
Re: [bug-gawk] mktemp ? |
Date: |
Fri, 24 Jan 2014 13:22:01 +0200 |
User-agent: |
Heirloom mailx 12.5 6/20/10 |
Hi.
Cedric is correct - the list is for more than just bug reports.
Andy is also correct - your questions are all answered in the manual. :-)
But in brief, once a pipeline has produced all the output it is going
to, such as in this case, you must first close it before starting
another one. And awk is different than shell: > truncates the file
the first time it's used, but it then stays open until you close it.
Thanks to both of you,
Arnold
> Date: Fri, 24 Jan 2014 10:46:03 +0100
> From: Cedric Sodhi <address@hidden>
> To: "Andrew J. Schorr" <address@hidden>
> Cc: address@hidden
> Subject: Re: [bug-gawk] mktemp ?
>
> Thank you Andy.
>
> Please note that the description of this mailing list on
>
> http://savannah.gnu.org/mail/?group=gawk
>
> says "gawk bug reports, enhancement requests, and all else." and
> another, detailled description at
>
> https://lists.gnu.org/mailman/listinfo/bug-gawk
>
> says "Bug reports and all discussion about gawk.".
>
> regards,
> Cedric
>
> On Thu, Jan 23, 2014 at 07:53:28PM -0500, Andrew J. Schorr wrote:
> > On Fri, Jan 24, 2014 at 12:46:32AM +0100, Cedric Sodhi wrote:
> > > Does anyone have a clue why
> > >
> > > gawk 'BEGIN { "mktemp" | getline this; "mktemp" | getline that; print
> > > this " AND " that }'
> > >
> > > does only produce one tempfile?
> >
> > This is not a bug report. Such questions belong in comp.lang.awk.
> >
> > Here's a clue for you:
> >
> > gawk 'BEGIN {cmd = "mktemp"; cmd | getline this; close(cmd); cmd | getline
> > that; print this " AND " that }'
> >
> > > On top of that,
> > >
> > > print "Something" >this
> > >
> > > will actually append to the tempfile and not overwrite it as a
> > > single ">" usually does.
> >
> > Please read the manual.
> >
> > Regards,
> > Andy