Subject: Re: awk acting funny
From: [email-masked] (DJ Delorie)

28 Oct 1996 22:12:27 -0800
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Original-To: [email-masked]
Original-CC: [email-masked], [email-masked]
In-reply-to: <[email-masked]> (message from James
	Dumser on Mon, 28 Oct 1996 08: 19:53 -0600 (CST))
Original-Sender: [email-masked]

> 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
"[email-masked]" with one line of text: "help".