[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: The rule of using '{}' (awk)
From: |
Peng Yu |
Subject: |
Re: The rule of using '{}' (awk) |
Date: |
Fri, 21 Aug 2009 10:39:58 -0500 |
On Fri, Aug 21, 2009 at 10:34 AM, John Cowan<address@hidden> wrote:
> Peng Yu scripsit:
>
>> I get the following syntax error. The error is fixed if I remove the
>> out most '{}'. I am wondering what the rule is to use '{}' in awk.,
>> $ awk '{!/#.*/ {print $1,$2,$3}}' data.txt
>> awk: {!/#.*/ {print $1,$2,$3}}
>> awk: ^ syntax error
>
> Awk statements contain a pattern and an action; both are optional.
> The action part is enclosed in braces. If you enclose the whole thing
> in braces, it looks like an action part, and awk doesn't like the
> regular expression followed by the block without any separator (; or newline)
> between them. Removing the outer braces is the Right Thing.
>
> This isn't an appropriate question for this list, however, which is about
> gawk bugs.
I looked at the web site of gawk. But I don't find a more appropriate
mailing list to ask user questions on gawk.
It says on the webpage, "awk has one mailing list: <address@hidden>.
It is used to discuss all aspects of Gawk. This is an alias for the
bug-gnu-utils list, if you want to subscribe or look at the archive."
Therefore, I thought that I can send questions to this address. Where
should I send future gawk user questions?
Regards,
Peng