From: dj AT delorie DOT com (DJ Delorie) Subject: Re: awk acting funny 28 Oct 1996 22:12:27 -0800 Sender: daemon AT cygnus DOT com Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <199610290117.UAA03455.cygnus.gnu-win32@delorie.com> Original-To: dumser AT lesol1 DOT dseg DOT ti DOT com Original-CC: reed AT engr DOT orst DOT edu, gnu-win32 AT cygnus DOT com In-reply-to: <199610281419.IAA13892@lesol1.dseg.ti.com> (message from James Dumser on Mon, 28 Oct 1996 08: 19:53 -0600 (CST)) Original-Sender: owner-gnu-win32 AT cygnus DOT com > gawk isn't broken. bash isn't broken. If anything is "broken," it's > COMMAND.COM (CMD.EXE) [DOS shell] -- actually it's just different. gawk > does not interpret the single quotes; that's the shell's job. DOS shell > does not understand single quotes so it passes them to the gawk as is. COMMAND.COM does absolutely no interpretation of the command line at all. It send it to you as-is, including the space after the command name and the carriage return at the end. It does not know about quotes, single or double. Parsing it is entirely up to the application. Perhaps what cygnus's gawk is getting is a single argument (argv[1]) that includes the entire command line, including all the stray quotes, as if you had typed this at the unix command line: gawk \''{ printf("%d %s\n", $3, $2"); }'\' ^^ ^^ > So the bottom line is if you want to run your gawk script from a DOS > shell, you will probably need to read your gawk program from a file > (gawk -f pgm.awk). That explains why DJGPP's gawk works correctly from COMMAND.COM, as I stated in my previous message. - For help on using this list, send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".