bug-gawk
[Top][All Lists]
Advanced

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

Re: When would awk issue a warning message about invalid options?


From: arnold
Subject: Re: When would awk issue a warning message about invalid options?
Date: Mon, 05 Oct 2020 05:30:15 -0600
User-agent: Heirloom mailx 12.5 7/5/10

Arkadiusz Drabczyk <arkadiusz@drabczyk.org> wrote:

> > > 2. Shouldn't it be mentioned in gawktexi.in that warning messages are
> > > only issued in compatibility mode as already mentioned in the manpage?
> > > It could say for example:
> > >
> > > "In compatibility mode, as long as program text has been supplied, any
> > > other options are flagged as invalid with a warning message but are
> > > otherwise ignored."
> >
> > That's probably a good idea.
>
> ok, should I send a patch (I'm not sure if it makes sense for such
> small change)?

I will handle it.

> > > 3. What's the difference between -P and -c? This does not issue any
> > > warnings:
> > >
> > > $ awk -c  -f ./argv  --1 --oeue
> > > awk
> > > --1
> > > --oeue
> > >
> > > even though it the manpage it says that -c and -P are doing almost the
> > > same thing:
> > >
> > > -c
> > > --traditional
> > >               Run in compatibility mode.
> > >
> > > -P
> > > --posix
> > >               This turns on compatibility mode
> >
> > Read the full text of the paragraph associated with -P:
> >
> >     This turns on compatibility mode, with the following additional
> >     restrictions:
> >
> >       · \x escape sequences are not recognized.
> >
> >       · Only space and tab act as field separators when FS is set to a
> >     single space, newline does not.
> >
> >       · You cannot continue lines after ?  and :.
> >
> >       · The synonym func for the keyword function is not recognized.
> >
> >       · The operators ** and **= cannot be used in place of ^ and ^=.
> >
> > That seems quite clear to me.
>
> Sorry, I read it a couple of times and still don't get it. From my
> understanding, both -c and -P enable compatibility mode. If anything,
> it's -P that does not enable a pure compatibility mode but something
> close to it and hence awk -P ... shouldn't fall under `In
> compatibility mode' category, not the other way around. Can you
> explain it please?

I don't know how to make it any clearer:

     This turns on compatibility mode, with the following additional
     restrictions:

This says that all the restrictions of compatibility mode are in
force, PLUS the additional restrictions in the following list.
Thus, -P does also fall under compatibilty mode.

Thanks,

Arnold



reply via email to

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