[UFO Chicago] silly bash/awk problem -- fatal: cannot open file

Neil R. Ormos ormos at ripco.com
Fri Jun 22 06:45:46 PDT 2012


Neil R. Ormos wrote:
> Brian Sobolak wrote:

A few additional comments:

>> I had changed the file permissions and
>> Results... file is readable by all and my
>> script is set to execute.

11.  Gawk is reporting File not Found on the input
     file. If the problem were permissions, you'd
     get a message of the form:

     gawk: fatal: cannot open file `foo' for reading (Permission denied)

12.  The "awk: colWalk.awk:6:" part of the arror
     message indicates that the problem occurred
     around line 6.  (Note *around*.)  The
     numbered line is probably the last executable
     statement in the last BEGIN rule before the
     first non-BEGIN/END rule (i.e., the main
     loop).  If it's not very close to the
     beginning of the first non-BEGIN/END rule,
     that fact is worth investigating.

13.  Are you using getline explicitly anywhere in
     your program?  If so, how are you specifying
     the file from which you are reading?

14.  You might try adding this BEGIN rule (or
     adding just the for statement to your
     existing BEGIN rule).  It will print the
     arguments, including the input file name.

     BEGIN{for (i in ARGV) print i, ">" ARGV[i] "<";}

Happy hunting.

--Neil


More information about the ufo mailing list