Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <20021002124752.29041.qmail@web40604.mail.yahoo.com> Date: Wed, 2 Oct 2002 05:47:52 -0700 (PDT) From: Barry Buchbinder Subject: gawk not taking redirected input under command.com To: cygwin AT cygwin DOT com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii I have a problem with gawk. Under bash, it works as expected. Under command.com (win98se) it does the following when taking input from a pipe or by redirection. C:\> cat autoexec.bat | gawk '{ print "!" $0 "!" }' GAWK: cmd. line:2: fatal: file `-' is a directory C:\> gawk '{ print "!" $0 "!" }' < autoexec.bat GAWK: cmd. line:2: fatal: file `-' is a directory I similarly misbehaves when putting the awk script into a file and taking input from a pipe. C:\> cat t { print "!" $0 "!" } C:\> cat autoexec.bat | gawk -f t GAWK: t:3: fatal: file `-' is a directory C:\> gawk -f t < autoexec.bat GAWK: t:3: fatal: file `-' is a directory However taking input directly from a file works as expected. (I'll spare you the output.) C:\> gawk '{ print "!" $0 "!" }' autoexec.bat C:\> gawk -f t autoexec.bat Filtering through dos2unix or unix2dos before gawk doesn't help. Filtering through cat after awk doesn't help. --posix and --traditional don't help. Any suggestions? Thanks, - Barry Below is the output of "cygcheck -s -v -r -h" ============================== Cygwin Win95/NT Configuration Diagnostics Current System Time: Tue Oct 01 13:32:49 2002 Windows 98 SE Ver 4.10 Build 2222 Path: C:\cygwin\bin C:\cygwin\usr\local\bin . c:\bin c:\usr c:\WINDOWS c:\WINDOWS\COMMAND c:\ p:\UTILS t:\ORAWIN95\BIN c:\PROGRA~1\NETWOR~1\MCAFEE~1 c:\SNA95\system c:\DMI\BIN SysDir: C:\WINDOWS\SYSTEM WinDir: C:\WINDOWS Here's some environment variables that may affect cygwin: CYGWIN = `check_case:adjust codepage:oem envcache export glob:ignorecase strip_title title tty winsymlinks' HOME = `C:\cygwin\home\bbuchbinder' MAKE_MODE = `unix' PWD = `/c' USER = `BBuchbinder' Here's the rest of your environment variables: BIN = `c:\cygwin\bin' BLASTER = `A220 I5 D1 T4' CLASSPATH = `"C:\Program Files\JavaSoft\JRE\1.3.1\lib\ext\QTJava.zip"' CMDLINE = `c:\cygwin\bin\bash -i' COMSPEC = `C:\WINDOWS\COMMAND.COM' CVSROOT = `:pserver:anoncvs AT sources DOT redhat DOT com:/cvs/src' EDITOR = `vim' HISTCONTROL = `ignoredups' HOMEDRIVE = `C:' HOMEPATH = `\cygwin\home\bbuchbinder' HOSTNAME = `buchbin-1107' HOSTTYPE = `i686' LESS = `-M' LS_COLORS = `no=00:fi=00:di=01;44:ln=01;36:*.lnk=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:ex=01:*~=05;31:*.tmp=05;31:*.ttt=05;31:*.mtxt=05;31:*.ndx=05;31:*.cmd=01;32:*.exe=01:*.com=01:*.btm=01;32:*.bat=01;32:*.c=01;36:*.h=01;36:*.pl=01;36:*.pm=01;36:*.cgi=01;36:*.java=01;36:*.htm=01;36:*.html=01;36:*.tar=01;31:*.tgz=01;31:*.gz=01;31:*.tgz=01;31:*.bz2=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.ppm=01;35:*.xpm=01;35:*.tif=01;35:' MACHTYPE = `i686-pc-cygwin' OSTYPE = `cygwin' PAGER = `/bin/less.exe' PROMPT = `$e[0;36m$p$e[0;1m$g $e[0m$e[K' PS1 = `\[\e[1;35m\]1 \[\[\e[0;7m\]\!\[\e[0m\] \[\e[0;36m\]$PWD\[\e[0;1m\]> \[\e[0m\e]0;\s Prompt: sh: 1; hist: \!; dir: $PWD\a\]' PS2 = `\[\e[0;1m\]> \[\e[0m\]' PS3 = `\[\e[0;36m\]select[\e[0;1m\]: \[\e[0m\]' PS4 = `\[\e[0;1m\]+ \[\e[0m\]' QTJAVA = `"C:\Program Files\JavaSoft\JRE\1.3.1\lib\ext\QTJava.zip"' SHELL = `/bin/bash.exe' SHLVL = `1' SNDSCAPE = `C:\WINDOWS' TEMP = `c:\temp' TERM = `cygwin' TMP = `c:\tmp' TZ = `EST5EDT' VIM = `/usr/share/vim/vim61' WINBOOTDIR = `C:\WINDOWS' WINDIR = `C:\WINDOWS' _ = `/bin/cygcheck' Scanning registry for keys with `Cygnus' in them... HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu\&Programs\Cygnus Solutions (default) = (unsupported type) HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu\Tools\System\SHELLS\CygWin\Cygnus Solutions (default) = (unsupported type) HKEY_CURRENT_USER\Software\Cygnus Solutions HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin (default) = 0x00000100 HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2 (default) = `/' cygdrive flags = 0x00000022 HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\Program Options (default) = `check_case:adjust codepage:oem envcache export glob:ignorecase nostrip_title title tty winsymlinks export' HKEY_LOCAL_MACHINE\Software\Cygnus Solutions HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\Cygwin HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\Cygwin\mounts v2 (default) = `/cygdrive' cygdrive flags = 0x00000022 HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\Cygwin\mounts v2\/usr/X11R6/lib/X11/fonts (default) = `C:\cygwin\usr\X11R6\lib\X11\fonts' flags = 0x0000000a HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\Cygwin\mounts v2\/ (default) = `C:\cygwin' flags = 0x0000000a HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\Cygwin\mounts v2\/usr/bin (default) = `C:\cygwin/bin' flags = 0x0000000a HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\Cygwin\mounts v2\/usr/lib (default) = `C:\cygwin/lib' flags = 0x0000000a HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\Cygwin\Program Options (default) = `check_case:adjust codepage:oem envcache export glob:ignorecase nostrip_title title tty winsymlinks export' Listing available drives... Drv Type Size Free Flags Name a: fd N/A N/A c: hd FAT32 9748Mb 40% CP UN d: cd N/A N/A h: net NTFS 47449Mb 100% CP CS UN PA FC Big_E i: net NTFS 242732Mb 2% CP CS UN PA FC o: net NTFS 4095Mb 70% CP CS UN PA FC OTD p: net NTFS 7491Mb 15% CP CS UN PA FC q: net NTFS 94906Mb 54% CP CS UN PA FC Giant _E s: net NTFS 94906Mb 54% CP CS UN PA FC Giant _E t: net NTFS 94906Mb 54% CP CS UN PA FC Giant _E u: net NTFS 16221Mb 73% CP CS UN PA FC fd=floppy, hd=hard drive, cd=CD-ROM, net=Network Share CP=Case Preserving, CS=Case Sensitive, UN=Unicode PA=Persistent ACLS, FC=File Compression, VC=Volume Compression Mount entries: these map POSIX directories to your NT drives. -NT- -POSIX- -Type- -Flags- . / user binmode,cygdrive C:\cygwin\usr\X11R6\lib\X11\fonts /usr/X11R6/lib/X11/fonts system binmode C:\cygwin / system binmode C:\cygwin/bin /usr/bin system binmode C:\cygwin/lib /usr/lib system binmode . /cygdrive user binmode,cygdrive Looking to see where common programs can be found, if at all... Found: C:\cygwin\bin\bash.exe Found: C:\cygwin\bin\cat.exe Found: C:\cygwin\bin\cpp.exe Found: C:\cygwin\bin\find.exe Found: c:\WINDOWS\COMMAND\find.exe Warning: C:\cygwin\bin\find.exe hides c:\WINDOWS\COMMAND\find.exe Found: C:\cygwin\bin\gcc.exe Found: C:\cygwin\bin\gdb.exe Found: C:\cygwin\bin\ld.exe Found: C:\cygwin\bin\ls.exe Found: C:\cygwin\bin\make.exe Found: C:\cygwin\bin\sh.exe Looking for various Cygnus DLLs... (-v gives version info) 45k 2001/04/25 C:\cygwin\bin\cygform5.dll - os=4.0 img=1.0 sys=4.0 "cygform5.dll" v0.0 ts=2001/4/25 1:28 26k 2001/04/25 C:\cygwin\bin\cygmenu5.dll - os=4.0 img=1.0 sys=4.0 "cygmenu5.dll" v0.0 ts=2001/4/25 1:27 156k 2001/04/25 C:\cygwin\bin\cygncurses++5.dll - os=4.0 img=1.0 sys=4.0 "cygncurses++5.dll" v0.0 ts=2001/4/25 1:29 226k 2001/04/25 C:\cygwin\bin\cygncurses5.dll - os=4.0 img=1.0 sys=4.0 "cygncurses5.dll" v0.0 ts=2001/4/25 1:17 15k 2001/04/25 C:\cygwin\bin\cygpanel5.dll - os=4.0 img=1.0 sys=4.0 "cygpanel5.dll" v0.0 ts=2001/4/25 1:27 25k 2002/07/16 C:\cygwin\bin\cygltdl-3.dll - os=4.0 img=1.0 sys=4.0 "cygltdl-3.dll" v0.0 ts=2002/7/16 0:05 19k 2002/02/20 C:\cygwin\bin\cyggdbm.dll - os=4.0 img=1.0 sys=4.0 "cyggdbm.dll" v0.0 ts=2002/2/19 22:05 929k 2002/06/24 C:\cygwin\bin\cygiconv-2.dll - os=4.0 img=1.0 sys=4.0 "cygiconv-2.dll" v0.0 ts=2002/6/24 14:24 23k 2002/06/24 C:\cygwin\bin\cygintl-2.dll - os=4.0 img=1.0 sys=4.0 "cygintl-2.dll" v0.0 ts=2002/6/24 0:54 21k 2001/06/20 C:\cygwin\bin\cygintl.dll - os=4.0 img=1.0 sys=4.0 "cygintl.dll" v0.0 ts=2001/6/20 13:09 170k 2002/01/21 C:\cygwin\bin\cygpng2.dll - os=4.0 img=1.0 sys=4.0 "cygpng2.dll" v0.0 ts=2002/1/20 20:05 35k 2002/01/09 C:\cygwin\bin\cygform6.dll - os=4.0 img=1.0 sys=4.0 "cygform6.dll" v0.0 ts=2002/1/9 1:03 20k 2002/01/09 C:\cygwin\bin\cygmenu6.dll - os=4.0 img=1.0 sys=4.0 "cygmenu6.dll" v0.0 ts=2002/1/9 1:03 175k 2002/01/09 C:\cygwin\bin\cygncurses++6.dll - os=4.0 img=1.0 sys=4.0 "cygncurses++6.dll" v0.0 ts=2002/1/9 1:03 202k 2002/01/09 C:\cygwin\bin\cygncurses6.dll - os=4.0 img=1.0 sys=4.0 "cygncurses6.dll" v0.0 ts=2002/1/9 1:03 12k 2002/01/09 C:\cygwin\bin\cygpanel6.dll - os=4.0 img=1.0 sys=4.0 "cygpanel6.dll" v0.0 ts=2002/1/9 1:03 17k 2001/06/28 C:\cygwin\bin\cyghistory4.dll - os=4.0 img=1.0 sys=4.0 "cyghistory4.dll" v0.0 ts=2001/1/6 23:34 50k 2002/03/12 C:\cygwin\bin\cygz.dll - os=4.0 img=1.0 sys=4.0 "cygz.dll" v0.0 ts=2002/3/11 23:38 108k 2001/06/28 C:\cygwin\bin\cygreadline4.dll - os=4.0 img=1.0 sys=4.0 "cygreadline4.dll" v0.0 ts=2001/1/6 23:34 20k 2002/07/17 C:\cygwin\bin\cyghistory5.dll - os=4.0 img=1.0 sys=4.0 "cyghistory5.dll" v0.0 ts=2002/7/17 17:18 40k 2001/11/21 C:\cygwin\bin\cygpcre.dll - os=4.0 img=1.0 sys=4.0 "cygpcre.dll" v0.0 ts=2001/11/21 17:15 39k 2001/11/21 C:\cygwin\bin\cygpcreposix.dll - os=4.0 img=1.0 sys=4.0 "cygpcreposix.dll" v0.0 ts=2001/11/21 17:15 22k 2001/12/13 C:\cygwin\bin\cygintl-1.dll - os=4.0 img=1.0 sys=4.0 "cygintl-1.dll" v0.0 ts=2001/12/13 4:28 127k 2002/07/17 C:\cygwin\bin\cygreadline5.dll - os=4.0 img=1.0 sys=4.0 "cygreadline5.dll" v0.0 ts=2002/7/17 17:18 54k 2002/01/27 C:\cygwin\bin\cygbz21.0.dll - os=4.0 img=1.0 sys=4.0 "cygbz21.0.dll" v0.0 ts=2002/1/26 20:07 175k 2002/07/22 C:\cygwin\bin\cygpng10.dll - os=4.0 img=1.0 sys=4.0 "cygpng10.dll" v0.0 ts=2002/7/22 11:51 119k 2002/02/09 C:\cygwin\bin\cygjpeg6b.dll - os=4.0 img=1.0 sys=4.0 "cygjpeg6b.dll" v0.0 ts=2002/2/9 0:19 179k 2002/07/22 C:\cygwin\bin\cygpng12.dll - os=4.0 img=1.0 sys=4.0 "cygpng12.dll" v0.0 ts=2002/7/22 12:03 253k 2002/02/10 C:\cygwin\bin\cygtiff3.dll - os=4.0 img=1.0 sys=4.0 "cygtiff3.dll" v0.0 ts=2002/2/10 3:34 22k 2002/06/09 C:\cygwin\bin\cygpopt-0.dll - os=4.0 img=1.0 sys=4.0 "cygpopt-0.dll" v0.0 ts=2002/6/9 1:45 58k 2002/05/07 C:\cygwin\bin\cygbz2-1.dll - os=4.0 img=1.0 sys=4.0 "cygbz2-1.dll" v0.0 ts=2002/5/7 2:33 452k 2002/07/17 C:\cygwin\bin\cygcurl-2.dll - os=4.0 img=1.0 sys=4.0 "cygcurl-2.dll" v0.0 ts=2002/7/17 10:50 625k 2002/08/09 C:\cygwin\bin\cygcrypto.dll - os=4.0 img=1.0 sys=4.0 "cygcrypto.dll" v0.0 ts=2002/8/9 16:20 159k 2002/08/09 C:\cygwin\bin\cygssl.dll - os=4.0 img=1.0 sys=4.0 "cygssl.dll" v0.0 ts=2002/8/9 16:20 883k 2002/07/06 C:\cygwin\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0 "cygwin1.dll" v0.0 ts=2002/7/6 2:16 Cygwin DLL version info: DLL version: 1.3.12 DLL epoch: 19 DLL bad signal mask: 19005 DLL old termios: 5 DLL malloc env: 28 API major: 0 API minor: 54 Shared data: 3 DLL identifier: cygwin1 Mount registry: 2 Cygnus registry name: Cygnus Solutions Cygwin registry name: Cygwin Program options name: Program Options Cygwin mount registry name: mounts v2 Cygdrive flags: cygdrive flags Cygdrive prefix: cygdrive prefix Cygdrive default prefix: Build date: Sat Jul 6 02:16:58 EDT 2002 CVS tag: cygwin-1-3-12-1 Shared id: cygwin1S3 Cygwin Package Information Last downloaded files to: C:\cygwin\arc Last downloaded files from: ftp://mirrors.rcn.net/mirrors/sources.redhat.com/cygwin Package Version WindowMaker 0.80.0-2 XFree86-base 4.2.0-1 XFree86-bin 4.2.0-2 XFree86-doc 4.2.0-1 XFree86-etc 4.2.0-1 XFree86-f100 4.2.0-2 XFree86-fenc 4.2.0-2 XFree86-fnts 4.2.0-2 XFree86-fscl 4.2.0-2 XFree86-html 4.2.0-1 XFree86-lib 4.2.0-3 XFree86-man 4.2.0-1 XFree86-prog 4.2.0-1 XFree86-startup-scripts4.2.0-3 XFree86-xserv 4.2.0-10 _update-info-dir 00067-1 ash 20020731-1 astyle 1.15.3-3 autoconf 2.53b-1 autoconf-devel 2.53a-1 autoconf-stable 2.13-4 automake 1.6.2-1 automake-devel 1.6.2-1 automake-stable 1.4p5-5 base-files 1.0-1 base-passwd 1.0-1 bash 2.05b-5 bc 1.06-1 binutils 20020706-2 bison 1.35-1 byacc 1.9-1 bzip2 1.0.2-2 cgoban 1.9.12-1 clear 1.0-1 cpio 2.4.2 crypt 1.0-1 ctags 5.2-1 curl 7.9.8-2 cvs 1.11.0-1 cygutils 1.1.2-1 cygwin 1.3.12-4 cygwin-doc 1.1-2 dejagnu 20010117-1 diff 1.0-1 diffutils 2.8.1-1 ed 0.2-1 enscript 1.6.3-3 expect 20010117-1 figlet 2.2-1 file 3.37-1 fileutils 4.1-1 findutils 4.1.7-4 flex 2.5.4-2 fortune 1.8-2 fvwm 2.4.7-2 gawk 3.1.1-3 gcc 2.95.3-5 gcc-mingw 3.2-20020817-1 gdb 20010428-3 gdbm 1.8.0-4 gettext 0.11.2-2 ghostscript 7.05-1 ghostscript-base 7.05-1 ghostscript-x11 7.05-1 gnugo 3.2-1 gperf 0.0 grep 2.5-1 groff 1.17.2-1 gzip 1.3.3-4 indent 2.2.8-1 inetutils 1.3.2-19 jpeg 6b-7 less 374-1 lesstif 0.93.18-3 libPropList 0.10.1-3 libbz2_0 1.0.2-1 libbz2_1 1.0.2-2 libiconv2 1.8-2 libintl 0.10.38-3 libintl1 0.10.40-1 libintl2 0.11.2-2 libltdl3 20020705-2 libncurses5 5.2-1 libncurses6 5.2-8 libpng 1.2.4-2 libpng10 1.0.14-2 libpng12 1.2.4-2 libpng2 1.0.12-1 libpopt0 1.6.4-4 libreadline4 4.1-2 libreadline5 4.3-1 libtool 20020705-1 libtool-devel 20020705-2 libtool-stable 1.4.2-2 links 0.96-1 login 1.4-4 lynx 2.8.4-1 m4 0.0 make 3.79.1-7 man 1.5g-2 mc 4.5.55-1 mingw 20010917-1 mingw-runtime 2.2-1 mktemp 1.4-1 more 2.11o-1 ncftp 3.1.4-1 ncurses 5.2-8 newlib-man 20020801 openbox 0.99.1-3 openssl 0.9.6g-1 patch 2.5-3 pcre 3.7-1 perl 5.6.1-2 perl_manpages 5.8.0-1 pinfo 0.6.6p1-1 popt 1.6.4-4 readline 4.3-1 robots 2.0-1 rsync 2.5.5-1 rxvt 2.7.2-14 sed 3.02-1 sh-utils 2.0-2 sharutils 4.2.1-2 shutdown 1.2-2 tar 1.13.19-1 termcap 20020930-1 terminfo 5.2-3 texinfo 4.2-3 textutils 2.0.21-1 tidy 020822-1 tiff 3.5.7-1 time 1.7-1 units 1.77-1 unzip 5.50-1 upx 1.21-1 vim 6.1-2 w32api 2.0-1 wget 1.8.2-1 which 1.5-1 whois 4.5.17-1 zip 2.3-2 zlib 1.1.4-1 ============================== __________________________________________________ Do you Yahoo!? New DSL Internet Access from SBC & Yahoo! http://sbc.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/