codership/mysql-wsrep

Test for '-k' option fails; FreeBSD timeout(1) prints help to stderr but this is not captured

ltning opened this issue · 0 comments

if timeout --help | grep -q -- '-k';then

This needs to capture stderr in addition to stdout.

Consider this example:

$ if timeout --help | grep -q -- '-k';then echo 'has -k';fi
Usage: timeout [--signal sig | -s sig] [--preserve-status] [--kill-after time | -k time] [--foreground] <duration> <command> <arg ...>

vs this:

$ if timeout --help 2>&1| grep -q -- '-k';then echo 'has -k';fi
has -k