benhoyt / goawk

A POSIX-compliant AWK interpreter written in Go, with CSV support

Home Page:https://benhoyt.com/writings/goawk/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong order of output with pipe and print

xonixx opened this issue · comments

Hi!

# delme.awk
BEGIN {
  print "222" | (cmd = "cat")
  close(cmd)
  print "DONE"
}
$ gawk -f delme.awk 
222
DONE

$ mawk -f delme.awk 
222
DONE

$ ./soft/bwk -f delme.awk 
222
DONE

$ ./soft/goawk1.23.1 -f delme.awk 
DONE
222

Interesting. Yes, this definitely doesn't seem right. Thanks for the bug report!