Re: gawk: invalid argument

From: Bill Marcum (bmarcum_at_iglou.com.urgent)
Date: 12/04/03


Date: Thu, 4 Dec 2003 17:01:47 -0500

On Thu, 04 Dec 2003 19:59:06 GMT, Harry
  <harryooopotter@hotmail.co_> wrote:
>
> The script is more than 600 lines long.
>
> Apparently it is the length of the script causing gawk to bark
> "invalid argument." If I break the script into two (see below), it
> works fine.
>
> Here is how I break the script into two pieces.
> .... in the middle of the script ...
> -- at around line 350 .....
> printf "EA@_39 (Filler) \t\t= " substr($0,274,47) "\n"
> }
> END {}
> ' $infile
>
> $AWK ' { }
> /^#FA0/ { printf "\n>>>\n" $0 "<<<\n"
> printf "FA0_1 (Record ID) \t\t= " substr($0,1,3) "\n"
> printf "FA0_2 (Squence Number) \t\t= " substr($0,4,2) "\n"
> --
>
> This workaround parses the first half of the infile, generates output,
> and then continue to parse the next half. It's no good, as the output
> consists of results no longer having the same sequence of the input
> patterns (AA0, BA0, ... XA0, BA0,...., XA0, etc).
>
> Is is a bug in gawk? How can I resolve the "invalid argument" issue?
>
It might be a limitation of your shell. Put the script in a file and
execute it with gawk -f.

-- 
Thanks to Nigeria, any email with the word "urgent" in the subject 
or address will be deleted.


Relevant Pages

  • gawk: invalid argument
    ... I have a cygwin gawk script giving me an error on W2KP's command ... NSF_decode.sh: ./gawk: Invalid argument ... The script is more than 600 lines long. ... This workaround parses the first half of the infile, generates output, ...
    (comp.unix.shell)
  • Killer scripts
    ... I am trying to understand how to monitor SQL Server for various performance ... problems and would like to find some scripts to cause performance problems. ... A script causing high memory usage ...
    (microsoft.public.sqlserver.programming)