[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: IFS system variable
From: |
Ian Macdonald |
Subject: |
Re: IFS system variable |
Date: |
Thu, 14 Feb 2002 10:22:41 -0800 |
User-agent: |
Mutt/1.2.5.1i |
On Thu 14 Feb 2002 at 20:00:12 +0200, you wrote:
> If eric's entry in the password file is not the first one, the code as
> you sent it will work; the assignment changes FS for subsequent records.
> But it's not right for the entire file; in particular, the first record
> is split using the default value of FS.
Ah, I see.
I usually wrap such things in a BEGIN {} clause anyway, so after you
pointed out the error of my ways, I was surprised to find that my
quick one-liner worked at all.
> Unix awk indeed used to work the way you wrote the program: if you
> changed FS before mucking with the fields, the record would be split
> with the new FS, but these semantics are just plain wrong and the Bell
> Labs awk has been fixed for a long time, as has the POSIX standard.
Thanks for the explanation.
Ian
--
Ian Macdonald | Nobody said computers were going to be
ian@caliban.org | polite.
|
|
|