diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2023-03-08 17:30:45 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2023-03-08 17:30:45 +0000 |
commit | b4edd43451ffbfbd162dbf8d162cf93327072ac2 (patch) | |
tree | e27668ab894edcc4367e8f72e12b5bf14b7ce3ee /tcwg-benchmark.sh | |
parent | ae761aae97f33609aeffc9bc2b0caf38adc40daf (diff) |
Do not "<output> | grep -q", use "<output> | grep -q ... >/dev/null" instead
When 'grep' in invoked with -q option, it exits with the first match,
and closes the input pipe. This will break the pipe and scripts running
with "-o pipefail" will get unexpected results.
Replace "<output> | grep -q", with "<output> | grep -q ... >/dev/null"
throught our scripts. Leave "grep -q ... <input_file>" intact, since
pipes are not involved.
Change-Id: I9438919276c0d0e235600384a979b511e1a4edff
Diffstat (limited to 'tcwg-benchmark.sh')
-rwxr-xr-x | tcwg-benchmark.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tcwg-benchmark.sh b/tcwg-benchmark.sh index 4c7e6b3b..894404ff 100755 --- a/tcwg-benchmark.sh +++ b/tcwg-benchmark.sh @@ -95,7 +95,7 @@ case "$toolchain_url" in else build_container_tag="${builder#*:}" builder="${builder%:*}" - if echo "$builder" | grep -q ".*-[0-9]\+"; then + if echo "$builder" | grep ".*-[0-9]\+" >/dev/null; then # Builder is a specific node docker_host_opt="--arch amd64 --node $builder" else @@ -259,7 +259,7 @@ case "$sysroot" in esac } -if echo "$results_id" | grep -q "\.\."; then +if echo "$results_id" | grep "\.\." >/dev/null; then echo "ERROR: results_id should not escape /home/tcwg-benchmark/results* hierarchy; do not use \"..\"" exit 1 fi |