bug-gnu-utils
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]