Why does output appear in wrong order?

前端 未结 2 1791
情书的邮戳
情书的邮戳 2020-12-11 11:32

I\'m trying to write a Groovy script that wraps another command and am having trouble with the stdout/stderr order. My script is below:

#!/usr/bin/env groovy         


        
2条回答
  •  再見小時候
    2020-12-11 12:03

    Try putting System.out.flush after you do your println. If I am right, the messages are appearing in different orders because the System.out is being buffered.

提交回复
热议问题