Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

-L doesn't work, but --lint does?

54 views
Skip to first unread message

Kenny McCormack

unread,
Dec 24, 2017, 8:19:49 AM12/24/17
to
When I run "gawk" with no parameters, I get:
(Note: gawk version is 4.1.1; I get the same results with 4.1.4)

$ gawk
Usage: gawk [POSIX or GNU style options] -f progfile [--] file ...
Usage: gawk [POSIX or GNU style options] [--] 'program' file ...
POSIX options: GNU long options: (standard)
-f progfile --file=progfile
-F fs --field-separator=fs
-v var=val --assign=var=val
Short options: GNU long options: (extensions)
-b --characters-as-bytes
-c --traditional
-C --copyright
-d[file] --dump-variables[=file]
-D[file] --debug[=file]
-e 'program-text' --source='program-text'
-E file --exec=file
-g --gen-pot
-h --help
-i includefile --include=includefile
-l library --load=library
-L [fatal] --lint[=fatal]
-n --non-decimal-data
-M --bignum
-N --use-lc-numeric
-o[file] --pretty-print[=file]
-O --optimize
-p[file] --profile[=file]
-P --posix
-r --re-interval
-S --sandbox
-t --lint-old
-V --version

To report bugs, see node `Bugs' in `gawk.info', which is
section `Reporting Problems and Bugs' in the printed version.

gawk is a pattern scanning and processing language.
By default it reads standard input and writes standard output.

Examples:
gawk '{ sum += $1 }; END { print sum }' file
gawk -F: '{ print $1 }' /etc/passwd
$

I draw your attention to the line that contains "-L" (uppercase L) and
implies that that is equivalent to --lint. I generally prefer to use the
short options - easier to type.

However, when I do:

$ gawk -L -f SomeScript NotAFile
gawk: fatal: cannot open file `NotAFile' for reading (No such file or
directory)

But the same thing with --lint instead of -L works as expected.
(I.e., runs the program as expected, and generates (lots of) lint warnings)

Note that SomeScript is a script that examines and then discards ARGV[1],
so the fact that that name does not reference a file is not an issue.

--
In politics and in life, ignorance is not a virtue.
-- Barack Obama --

Manuel Collado

unread,
Dec 24, 2017, 10:06:24 AM12/24/17
to
This seems a real bug. So please:

- Tell what is your platform (the OS, etc., not just the gawk version)
- Strip down your script and post a minimal buggy code, so the bug can
be reproduced by others.
- Send the report to bug-...@gnu.org, instead of c.l.a newsgroup.

> To report bugs, see node `Bugs' in `gawk.info', which is
> section `Reporting Problems and Bugs' in the printed version.

But you surely already know all that.

Regards.
Manuel Collado - http://lml.ls.fi.upm.es/~mcollado

Kenny McCormack

unread,
Jan 29, 2018, 4:28:13 PM1/29/18
to
In article <5A3FC26E...@users.sourceforge.net>,
Manuel Collado <m-co...@users.sourceforge.net> wrote:
>This seems a real bug. So please:
>
>- Tell what is your platform (the OS, etc., not just the gawk version)
>- Strip down your script and post a minimal buggy code, so the bug can
>be reproduced by others.
>- Send the report to bug-...@gnu.org, instead of c.l.a newsgroup.
>
> > To report bugs, see node `Bugs' in `gawk.info', which is
> > section `Reporting Problems and Bugs' in the printed version.
>
>But you surely already know all that.

Perusing the ChangeLog in the latest GAWK release (the one just announced
here by Arnold), I find:

* main.c (optlist): Make 'L' option's argument optional, to
match --lint. Thanks to Manuel Collado <mcolla...@gmail.com>
for the report.

So, congrats to Manuel for following through on this issue.

Later, in that file, we find:

* main.c (usage): Add a note to not post bugs in comp.lang.awk.
So there.

To which I would like to point out that there is a difference between what
we do for fun vs. what we do because we really want to change the world.
As an analogy, one might say that discussing politics down at the corner
bar is pointless and you should, instead, write a letter to your
congressman. Well, the fact is that rapping with your friends at the bar
is fun, while writing letters (particularly, in this post-literate age in
which we live) is work. No amount of arguing is going to change that fact.

So, I find writing here in comp.lang.awk to be fun. Sending email to some
anonymous mailing list, not so.

--
I am not a troll.
Rick C. Hodgin
I am not a crook.
Rick M. Nixon
0 new messages