[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-gawk] Numeric Assignment to $0 Requires Coercion.
From: |
Ralph Corderoy |
Subject: |
[bug-gawk] Numeric Assignment to $0 Requires Coercion. |
Date: |
Mon, 30 Jul 2018 11:58:14 +0100 |
Hi,
gawk 4.2.1-1 on Arch Linux.
$ yes a b c | sed 5q | awk '{$2 = ++i} 1'
a 1 c
a 2 c
a 3 c
a 4 c
a 5 c
$ yes a b c | sed 5q | awk '{$0 = ++i} 1'
$ yes a b c | sed 5q | awk '{$0 = ++i ""} 1'
1
2
3
4
5
$
I wouldn't expect to have to force `++i' into a string context before
the assignment to `$0'. I do hope my awk skills haven't bit-rotted.
--
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy
- [bug-gawk] Numeric Assignment to $0 Requires Coercion.,
Ralph Corderoy <=