Subject: Re: gawk not taking redirected input under command.com
From: "Peter S Tillier" <[email-masked]>
To: "Cygwin" <[email-masked]>
Date: Sat, 5 Oct 2002 08:28:28 +0100

----- Original Message -----
From: "Barry Buchbinder" <[email-masked]>
To: "Cygwin" <[email-masked]>
Sent: Friday, October 04, 2002 1:55 PM
Subject: RE: gawk not taking redirected input under command.com

> I get the same problems under under win95cmd.exe.  It
> fails with redirection but not reading input from a
> file:
>
>   C:\> c:\cygwin\bin\gawk -f t < autoexec.bat
>   gawk: t:3: fatal: file `-' is a directory
>
> Running under strace and back under command.com I get
> the following:
>
>   C:\> type t | c:\cygwin\bin\strace -o strace.out
> c:\cygwin\bin\gawk -f t
>   gawk: t:3: fatal: file `-' is a directory
>
> I've attached strace's output.
>
> Might the fact that the line number quoted is *after*
> the end of the file tell us something?  (t has 2 lines
> but the error is in line 3.  When the script is on the
> command line, the error is in line 2.)
>
> Thanks again,
>
> - Barry Buchbinder
>

On my system (Win98SE) using Win95Cmd I get (with Cygwin gawk-3.1.1-3):

C:\WINDOWS>\cygwin\bin\gawk "BEGIN {print \"hi\"}; END {print \"bye\"}"
<\autoexec.bat
hi
gawk: cmd. line:1: fatal: file `-' is a directory

C:\WINDOWS>

OTOH:

C:\WINDOWS>\cygwin\bin\gawk "BEGIN {print \"hi\"};END {print \"bye\"}"
\autoexec.bat
hi
bye

C:\WINDOWS>

works fine.

I don't get this problem if I run the GNUWin32 port of gawk-3.1.0-2 or
the DJGPP version of gawk-3.1.1 at a Win95Cmd command line.  So it looks
like there's problem with the Cygwin port running under command.com or
win95cmd somewhere.  I suppose it isn't something to do with the cygwin
dlls not being in the path?  Although I'd expect some missing dll
messages if that were the case.

Peter S Tillier        [email-masked]

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/