bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] Debugging Script


From: arnold
Subject: Re: [bug-gawk] Debugging Script
Date: Sun, 14 Apr 2019 08:33:04 -0600
User-agent: Heirloom mailx 12.5 7/5/10

I might do this as an Easter Egg. It's not worth the trouble
of making it a full blown feature, documented, supported, etc.

david kerns <address@hidden> wrote:

> There is a feature request to be had here though...
> I often have a wrapper shell script around my awk programs, and when
> there's a syntax error in the awk program I get a fatal error with a line
> number. But the line number is relative to start of the awk program, not
> the entire script (which is what I edit). bash's LINENO variable is not
> export by default and is not set unless evaluated (per experimentation, not
> a read of the source code) so you'd have to -v LINENO=$LINENO on the awk
> cmd line... but it would be handy if LINENO was set, to add it to the
> reported value. Since the developer had do something to manipulate LINENO
> you could get away without reporting both values.
> ... mull it over ;)
>
> On Sun, Apr 14, 2019 at 1:16 AM <address@hidden> wrote:
>
> > Holger Klene <address@hidden> wrote:
> >
> > > So if a normal file is a glass of beer, you say these strange files
> > > cannot be put on the table, you have to drink them in one go.
> >
> > A normal file is a piece of paper you can read as many times as you
> > want.  The other files self-destruct after reading them once. :-)
> >
> > > Yes indeed, it is a feature request! The author of the document foresaw
> > > it coming [1] ... and ever since whenever people stumbled over it, it
> > > gives the impression: this is a known topic and you better not waste
> > > anybody's time by asking a question from the FAQ again.
> >
> > I think you're reading more into it than what's there.
> >
> > > Meanwhile a kind soul taught me how easy it can be to write a temporary
> > > file (I better not go into the details of what I tried to accomplish the
> > > same):
> > >
> > > > cat <<'TheEnd' >/tmp/$USER$$
> > > >    .
> > > >    . 20 lines of awk code, nicely indented
> > > >    .
> > > > TheEnd
> > > > gawk -f /tmp/$USER$$
> > > > rm /tmp/$USER$$
> >
> > This is indeed the way to go.
> >
> > > Maybe you could add something like this as a "known workaround" to the
> > > known limitations [1]?
> >
> > I will try to add something.
> >
> > > In the end I could solve my problem and with your explanations, I
> > > somewhat understand it now.
> >
> > Great. Enjoy.
> >
> > Arnold
> >
> >




reply via email to

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