some questions about awk

pdg at ihdev.UUCP pdg at ihdev.UUCP
Thu Feb 19 02:35:16 AEST 1987


In article <1446 at umd5> zben at umd5.umd.edu (Ben Cranston) writes:
>awk 'BEGIN { fnam = FILENAME }
>(fnam!=FILENAME) { NR=1 ; fnam=FILENAME ; printf "%c\n",12 }
>{ print }
>(65==((NR-1)%66)) { printf "%c\n",12 }' $*
>There is a bug if you feed it the same file(name) twice.  Any REAL awk
>freaks out there know a solution to this?  

In the REAL awk on my machine , just test  FNR == 1  (Line number in
the current file). But as has been mentioned before, this will not
become available until the next release of SVR3.  Or of course you
could parse through the file list yourself by using ARGV[].
This probably didn't help anyone at all, but its nice to know what to
look forward to in the future.



-- 

Paul Guthrie
ihnp4!ihdev!pdg			This Brain left intentionally blank.



More information about the Comp.unix.questions mailing list