Hudson : “yes: standard output: Broken pipe”

后端 未结 5 890
一生所求
一生所求 2021-02-18 19:02

I need to run a shell script in hudson. That script needs an answer from the user. To give an automatic answer I did the following command line :  

yes         


        
5条回答
  •  旧时难觅i
    2021-02-18 19:26

    I had this error, and my problem with it is not that it output yes: standard output: Broken pipe but rather than it returns an error code.

    Because I run my script with bash strict mode including -o pipefail, when yes "errors" it causes my script to error.

    How to avoid an error

    The way I avoided this is like so:

    bash -c "yes || true" | my-script.sh
    

提交回复
热议问题