>> I can't seem to get awk to work.
>> Here is the command line I'm trying to use:
>>
>> svn ls -R | awk "print $1"
>
> Try:
>
>            svn ls -R | awk "{print $1}"
>
> The default rule must be enclosed in braces.

Actually, this is not strictly so; while your suggested remedy
is correct in this instance, your explanation is wrong.

An awk "rule", (usually called a "statement", for it is a part
of an awk "script" which itself comprises one or more of such
statements), comprises two parts:

      match-criterion { action [; ...] }

It's the *action* part of the statement which must be enclosed
in braces, and this applies to *all* statements; (in fact, if any
statement is given at all, there is no applicable concept of a
"default"; any statement may omit either the match-criterion part,
which then defaults to matching *every* input line, or it may omit
the action part, which then defaults to echoing the entire matched
input line to the output stream.

The only way to get a "default rule" would be to not specify any
script at all; in that case, the entire awk invocation would become
rather pointless, for the "default script" simply echoes the entire
input stream to the output.  (And because such a "default script"
would be rather pointless, the awk command itself *requires* a
script to be specified, either directly on the command line, or
from a file specified by the `-f' option).

--

Regards,
Keith.
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
GnuWin32-Users mailing list
GnuWin32-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnuwin32-users

Reply via email to