I found this on cygwin on Windows XP. Notice the control characters on the
final line of output.
Reading http://www.gnu.org/manual/gawk/html_node/Bugs.html didn't point me to
the list of known bugs, so I don't know if this is a known problem or not.
Regards,
Ed Morton.
------------------------------------------------------------------------------------------------------------------------
$ gawk --version | head -2
GNU Awk 3.1.6
Copyright (C) 1989, 1991-2007 Free Software Foundation.
$ cat -v tst.awk
BEGIN {
FS = "-"
$0="foo,bar"
printf "FS=<%s> NF=<%d> $0=<%s> $1=<%s> $2=<%s>\n",FS,NF,$0,$1,$2
FS = ","
$0 = $1
printf "FS=<%s> NF=<%d> $0=<%s> $1=<%s> $2=<%s>\n",FS,NF,$0,$1,$2
$0 = $2
printf "FS=<%s> NF=<%d> $0=<%s> $1=<%s> $2=<%s>\n",FS,NF,$0,$1,$2
}
$ gawk -f tst.awk | cat -v
FS=<-> NF=<1> $0=<foo,bar> $1=<foo,bar> $2=<>
FS=<,> NF=<2> $0=<foo,bar> $1=<foo> $2=<bar>
FS=<,> NF=<1> $0=<M-TM-^]^T> $1=<M-TM-^]^T> $2=<>