Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stdout and stderr are intermixed #77

Closed
xonixx opened this issue Dec 20, 2021 · 1 comment · Fixed by #80
Closed

stdout and stderr are intermixed #77

xonixx opened this issue Dec 20, 2021 · 1 comment · Fixed by #80
Labels
bug Something isn't working

Comments

@xonixx
Copy link
Contributor

xonixx commented Dec 20, 2021

$ ./soft/bwk 'BEGIN { print "111"; print "222">"/dev/stderr"; print "333" }'
111
222
333

$ ./soft/mawk134 'BEGIN { print "111"; print "222">"/dev/stderr"; print "333" }'
111
222
333

$ ./soft/gawk511 'BEGIN { print "111"; print "222">"/dev/stderr"; print "333" }'
111
222
333

$ ./soft/goawk1.9.1 'BEGIN { print "111"; print "222">"/dev/stderr"; print "333" }'
222
111
333

This is a bit annoying since it's inconsistent with all major implementations.

This is the cause for failing test for makesure https://github.com/xonixx/makesure/runs/4585273788?check_suite_focus=true
And though I could write a test in a more resilient way, I would prefer to not add special logic for goawk.

I'm pretty sure this relates to #47.

@benhoyt
Copy link
Owner

benhoyt commented Dec 20, 2021

Thanks. This is a good data point. Yeah, it's definitely related to #47. It's happening because in GoAWK stdout is buffered, stderr is not (and GoAWK doesn't currently flush stdout automatically to synchronize things, like the other AWKs do).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants