Date: Sun, 11 Jan 1998 14:44:26 +0200 (IST) From: Eli Zaretskii To: Weiqi Gao cc: djgpp AT delorie DOT com Subject: Re: DJGPP gawk peculiarity In-Reply-To: <34B6D45A.8A0733FB@a.crl.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Fri, 9 Jan 1998, Weiqi Gao wrote: > ====================================================================== > C:\TEMP> cat junk > 123 456 > > C:\> awk 'length($1) < 2 {print $1}' junk > 123 > ====================================================================== > > What am I missing here? Did you actually run this from the DOS prompt? If so, which shell did you use? COMMAND.COM won't let Gawk run at all, since it doesn't understand single quotes and treats the < as an attempt to redirect input to a file named 2. This usually fails, but if you actually have a file by that name, the result will depend on what's in that file (which you didn't say). Replacing single quotes with double quotes makes this program work as I'd expect (i.e., print nothing), since COMMAND.COM then treats < as a normal character. The original command also works from Bash.