bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: gawk cannot control the use of interval expressions from within a pr


From: Stephane Chazelas
Subject: Re: gawk cannot control the use of interval expressions from within a program
Date: Fri, 5 Nov 2004 12:05:54 +0000
User-agent: Mutt/1.5.6i

On Thu, Nov 04, 2004 at 07:40:21PM -0300, Ruy Exel wrote:
> 
> Is it possible to make gawk understand interval expressions (like when it is
> given the option --re-interval) from within a gawk program?
> 
> I want to run a gawk program via the `#!' script interpreter and I do not know
> how to pass options to gawk in this case.  I attempted to start my script with
> the line:
> 
>     #!/usr/bin/gawk --re-interval -f
> 
> but it does not work.
[...]

That's not a problem with awk, that's a problem with your system
she-bang handling. The above would work with FreeBSD or MacOSX,
but wouldn't in most other Unices.

Because the she-bang generally accept one single argument. On
Linux, gawk would be called with the "-re-interval -f" argument.
On Solaris, it would be called with "-re-interval" argument and
not "-f" argument.

You can do it as:

<<
#! /bin/sh -
":" +0 && "exec" "/usr/bin/gawk" "-Wre-interval" "-f" "$0"

<Your gawk script goes here>
>>

-- 
Stéphane





reply via email to

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