Since we're engaging in a little friendly pedantry...

On 10/27/2009 6:30 AM, Keith MARSHALL wrote:

[attributions added back in]

> On 10/23/2009 10:56 AM, Charles Calvert wrote:

>> On 10/23/2009 10:31 AM, bradda...@comcast.net wrote:
> 
>>> 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",

Most of my understanding of awk comes from "Effective awk Programming"
and "sed & awk" in which Mr. Robbins tends to use the word "rule" rather
than the word "statement", so I think that "usually" depends on the
context.  I would agree that "statement" has a more well defined meaning
in a programming context, but plenty of programming languages have their
little variations on terminology.

> 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;

I did not imply the opposite.  Brad failed to enclose the action in
braces and I stated that he needed to do so.  I don't see how one can
reasonably conclude that this implies that braces should not enclose any
other action.  Perhaps I have misunderstood your use of emphasis in this
case?

> (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.

I should have said the "empty pattern"[1], but my mind came up with
"default" instead.  Thanks for the clarification.

[snip]

[1] "Effective awk Programming", third edition, p. 109.
-- 
Charles


------------------------------------------------------------------------------
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