awk problem
Anonymous
swell.k at gmail.com
Fri Aug 13 16:36:49 UTC 2010
merlyn at stonehenge.com (Randal L. Schwartz) writes:
> Len> awk 'FS="." { print $(NF-1)"."$NF }'
>
> Len> rm90.steampick.info.rm90.steampick.info
> Len> lanejive.info
> Len> govdelivery.com
> Len> orangetalon.info
> Len> carespecial.info
>
> Yes, that would be the expected behavior.
>
> You need to set the FS *before* processing the first line.
>
> Either use -F ., or a BEGIN block.
Then it's already fixed in 8.1-RELEASE by update in r201951.
contrib/one-true-awk/FIXES:
Nov 26, 2009:
fixed a long-standing issue with when FS takes effect. a
change to FS is now noticed immediately for subsequent splits.
More information about the freebsd-questions
mailing list