[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: An issue about gwak 3.1.1, is it a bug?
From: |
Jürgen Kahrs |
Subject: |
Re: An issue about gwak 3.1.1, is it a bug? |
Date: |
Mon, 23 Jul 2007 22:24:08 +0200 |
User-agent: |
Thunderbird 1.5.0.8 (X11/20060911) |
高磊 wrote:
> Here is an issue of gawk, may be a bug :
..
> And then I wrote a command as:
>
> $ awk 'FS="\t" gsub(/a/,"A",$1){print $0,NF}' a.log
What does this program really do ?
Remember that AWK expects "pattern - action" pairs.
Your FS="\t" is part of the pattern.
Is this what you intended ?
You probably intended
gawk 'BEGIN {FS="\t"}; gsub(/a/,"A",$1){print $0,NF}' a.log
bc 2Abc 1
3Abc 4abc 2
5Abc 6abc 2