This is not a bug, although some might disagree with the current behavior of bash.
With a command like 'yes | grep -q .', because the grep terminates early and the yes is writing past the end of the pipe buffer, the yes process is _always_ terminated with a SIGPIPE signal (which translates to a return value of 141). Combined with the pipefail option, the whole command is considered to have failed. pipefail should be used scarcely, that's why it is not enabled by default. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1394136 Title: if statement with pipe to grep randomly fails if pipefail is set To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1394136/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs