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

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

Re: GNU Awk 3.1.1


From: Aharon Robbins
Subject: Re: GNU Awk 3.1.1
Date: Sun, 03 Nov 2002 05:55:59 +0200

Greetings. Re this:

> From: jvilhena <address@hidden>
> To: address@hidden
> Date: Sun, 03 Nov 2002 00:48:56 -0000
> Subject: GNU Awk 3.1.1
>
> I'm using gawk 3.1.1 that comes with cygwin on a windows 98 PC.
> The following command in the file awktutor1, called with, "awk -f 
> awktutor1 awktext" doesn't print the filename "awktext".
>
> BEGIN  {  print "File:" , FILENAME }

This is the correct behavior.  FILENAME doesn't receive a value
until after the first record of input has been read, either via
a getline with no redirection, or from the implicit main loop.

You're probably better off using ARGV[1] to look at the filenames
within the BEGIN block.

Arnold





reply via email to

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