bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gawk bug


From: Bob Proulx
Subject: Re: gawk bug
Date: Wed, 26 Oct 2005 00:23:02 -0600
User-agent: Mutt/1.5.9i

Simon H. Charbel wrote:
> I am using gawk on windows xp, when I am trying to use the following:
> gawk "{ print "test" }"  the word "test" is not printed. The gawk
> version is 3.1.3.1614

There are several problems with your example.

* Your quoting is not correct.  GNU awk needs to see the inner set of
  quotes.  In a bash shell all it would see is { print test }.  That
  would read as if test is a variable and not a literal string.

* You have not supplied any input.  The {...} action will only be run
  if there is input.  The {...} action will be run for every line of
  input that it can read.

You say you are running on MS-Windows and there I don't know if there
is a way to get the quotes to pass through.  You are on your own
there.  But in a bash shell one would use this example.

  gawk 'BEGIN{ print "test"; }'
  test

Bob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]