Message-Id: <199801120920.KAA24820@sun4nl.NL.net> Date: Mon, 12 Jan 1998 10:38:00 +0100 From: Rob den Boer Subject: DJGPP gawk peculiarity To: djgpp Precedence: bulk Weiqi Gao wrote: >One of my coworkers showed me a peculiar behavior of the DJGPP awk: >C:\TEMP> cat junk >123 456 >C:\> awk 'length($1) < 2 {print $1}' junk >123 >What am I missing here? The basics of awk ;-)) awk 'runs' through the stdin executing between {}, in your case {print $1}, which prints the first field of every record. You placed 'length($1)<2' before {} which becomes a search condition. What you probably mean is { print length($1) } regards Rob den Boer