[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: FS bug in gawk
From: |
Stepan Kasal |
Subject: |
Re: FS bug in gawk |
Date: |
Fri, 18 Apr 2003 09:05:11 +0200 |
User-agent: |
Mutt/1.2.5.1i |
Hello,
On Thu, Apr 17, 2003 at 07:34:41PM +0200, Marek Antozi wrote:
> $ echo A_B_C | awk '{FS="_"; print $1}'
> A_B_C
this is the correct behaviour. First the fields have been splitted,
second, the value of FS was changed.
> $ echo A_B_C | awk '{FS="_"; print $1}'
> A
This is incorrect behaviour.
You should use
awk 'BEGIN{FS="_"}; {print $1}'
to achieve the desired effect.
HTH,
Stepan
- FS bug in gawk, Marek Antozi, 2003/04/17
- Re: FS bug in gawk,
Stepan Kasal <=