[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-gawk] Bug regarding setting of OFS
From: |
Johann Hartwig Hauschild |
Subject: |
[bug-gawk] Bug regarding setting of OFS |
Date: |
Thu, 9 Feb 2012 09:32:27 +0100 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
Hi.
I'm experiencing some strange behaviour with the OFS-Builtin:
~/.../gawk$ ./gawk -V |head -1
GNU Awk 4.0.70
~/.../gawk$ echo a:b:c|./gawk -F":" '{OFS=FS; $2="x";print}'
a:x:c
~/.../gawk$ echo a:b:c|./gawk -F":" '{$2="x"; OFS=FS; print}'
a:x:c
~/.../gawk$ echo a:b:c|./gawk -F":" '{$2="x"; print; OFS=FS; print}'
a x c
a x c
~/.../gawk$ echo a:b:c|./gawk -F":" '{$2="x"; print $1; OFS=FS; print}'
a
a:x:c
~/.../gawk$ echo a:b:c|./gawk -F":" '{$2="x"; print; $2=$2; OFS=FS; print}'
a x c
a:x:c
It seems to me that setting OFS causes the print-Statement to recompile
$0 only if another $n was touched, that is a bit confusing.
--
Gruß,
Hardy
- [bug-gawk] Bug regarding setting of OFS,
Johann Hartwig Hauschild <=