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

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

Re: New Gawk User


From: Bob Proulx
Subject: Re: New Gawk User
Date: Sun, 14 Feb 2010 14:06:21 -0700
User-agent: Mutt/1.5.18 (2008-05-17)

Julie & Nick Ippolito wrote:
> If this is not the right place for my query please point me to the
> right location.

This is the right place for gnu awk bugs and questions.  However jpeg
image screenshots are an extremely inefficient way to show us your
problems.  At 88k it wasn't unbearable but it was very close to it.
In the future please just include the *text* of the problem.  The text
is very small and can be viewed inline and quoted easily.  In your
case it was:

  Examples:
          gawk '{ sum += $1 }; END { print sum }' file
          gawk -F: '{ print $1 }' /etc/passwd

That is the standard examples from the GNU awk program.  However they
are Unix shell examples and you are running this on MS-Windows.
Arguably whoever did the port from GNU to MS should have adjusted the
examples for you.  Instead they just included them verbatim and that
is source of the confusion.  On a GNU or Unix system those examples
would work.

  C:\Documents and Settings\Nick>gawk '{ print $1 }' list
  gawk: '{ print $1 }'
  gawk: ^ invalid char ''' in expression

The problem is that you are using the MS-Windows command.com command
line but trying to use Unix shell style quoting.  On your command line
you need to use double quotes instead of single quotes.  I don't have
an MS-Windows machine to test this on but I would guess you would need
to do something like this using double quotes instead.

  gawk "{ print $1 }" list

Bob




reply via email to

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