[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] Options unavailable for executable awk script
From: |
arnold |
Subject: |
Re: [bug-gawk] Options unavailable for executable awk script |
Date: |
Mon, 08 Jan 2018 06:49:58 -0700 |
User-agent: |
Heirloom mailx 12.4 7/29/08 |
Hi.
Byron Hawkins <address@hidden> wrote:
> My executable awk script requires the option "--non-decimal-data", but the
> linux "#!" mechanism only allows one option on the "#!" line. For this
> reason, awk is obliged to provide a command that can enable the
> "--non-decimal-data" option from inside the script. But there is no such
> command. The obligation is not met, and therefore my correct awk script
> cannot be run as an executable.
On recent versions of gawk you may use the -n option together with -f
in a #! line:
#! /usr/bin/gawk -nf
Check the output from gawk --help to see if --non-decimal-data has
the corresponding short option. If not, you will need to update
your version of gawk.
> All options must have a corresponding command that can be run from inside
> the awk script. This is mandatory because of the linux "#!" limitation on
> arguments.
This is not true; it's enough if there is a single letter option that can
be grouped with -f, as in the case above.
Thanks,
Arnold