Hudson : "yes: standard output: Broken pipe"

Viewed 22647

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 | ./MyScript.sh

This works well in Ubuntu terminal. But when I use the same command in the Hudson job, the script will be automated and do all the needed work, but at the end, I get these two lines of error :

yes: standard output: Broken pipe
yes: write error

And this causes the failure to my Hudson job.

How should I change my command line to work well in Hudson?

5 Answers

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
Related