Open Pyrrha opened 6 months ago
There's more than one difference that I see, depending on the options used. Since awk (bwk) and gawk are giving the same result, it's something to investigate.
With neither FS or OFS, and changing the print to make it more apparent
$AWK '{$NF++;printf "{{%s}}", $0}'
mawk: {{1.2.99 }}
awk: {{2.2}}
$AWK -vFS=. '{$NF++;printf "{{%s}}", $0}'
mawk: {{1 2 99 }}
awk: {{1 2 100}}
$AWK -vFS=. -vOFS=: '{$NF++;printf "{{%s}}", $0}'
mawk: {{1:2:99:}}
awk: {{1:2:100}}
In the first example, I suppose that because the string does not look like a valid number, mawk ignores the increment. The second and third examples give the same result, so OFS
appears irrelevant. Whether mawk should increment the last field -- that seems familiar (perhaps already reported difference). So I'll keep this open until I've had a chance to investigate those two differences.
Hello,
I'm using the awk command to increase a version number.
However, when using the same command with mawk, I'm getting another behaviour.
I think this is an issue with OFS, but maybe not only. Could also be the parsing, that doesn't catch the \n properly? What do you think?
Thanks