[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Broken awk 3.0.4
From: |
Darrel Hankerson |
Subject: |
Re: Broken awk 3.0.4 |
Date: |
Thu, 4 Oct 2001 20:03:56 -0500 |
Olivier Lefevre" <address@hidden> writes:
If the current dir is
/sys/dev/src/screener, then echo `pwd` | nawk '{FS="/"; print NF}'
returns 5 under Solaris, as you would expect, but 1 under Cygwin,
which is the Solaris awk result.
Read the "Field Splitting Summary" of the Gawk manual ("Effective Awk
Programming"), which begins:
According to the POSIX standard, `awk' is supposed to behave as if
each record is split into fields at the time that it is read. In
particular, this means that you can change the value of `FS' after a
record is read, and the value of the fields (i.e. how they were split)
should reflect the old value of `FS', not the new one.
--Darrel Hankerson address@hidden
- Broken awk 3.0.4, Olivier Lefevre, 2001/10/04
- Re: Broken awk 3.0.4,
Darrel Hankerson <=