Closed ghshephard closed 12 months ago
I might have a fix for this in https://github.com/onetrueawk/awk/pull/163/files
Correct Behavior with PR:
$ ./awk '{printf "x"FS"x "; print $1":"$2}' t1 FS="[ ,]" t1 t1
x x 1,2:3
x x 4,5:6
x[ ,]x 1:2
x[ ,]x 4:5
x[ ,]x 1:2
x[ ,]x 4:5
And:
$ ./awk '{printf "x"FS"x "; print $1":"$2}' FS="[ ,]" t1 t1
x[ ,]x 1:2
x[ ,]x 4:5
x[ ,]x 1:2
x[ ,]x 4:5
thank you for spotting this unusual corner case.
latest release includes @mpinjr fix.
I think I just found a strange behavior in awk in which setting FS="[ ,]" doesn't work until at least one line in a file is read:
I don't think this is expected behavior.