[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:33:15 -0500 |
On Fri, Aug 21, 2009 at 10:25 AM, Peng Yu<address@hidden> wrote:
> Hi,
>
> 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.,
>
> Regards,
> Peng
>
> $ awk '{!/#.*/ {print $1,$2,$3}}' data.txt
> awk: {!/#.*/ {print $1,$2,$3}}
> awk: ^ syntax error
>
Why in the following case I can keep the out most '{}'?
$ awk '{if(NF == 3) {print $0}}' data.txt
a b c