diff --git a/bundled-tools-can-execute/test.sh b/bundled-tools-can-execute/test.sh index aa08ab04..449ed02d 100755 --- a/bundled-tools-can-execute/test.sh +++ b/bundled-tools-can-execute/test.sh @@ -23,7 +23,7 @@ for tool in "${!tools[@]}"; do # Ignore the exit code because 'dotnet user-secrets' has a non-zero exit for '--help'. output=$(dotnet "${tool}" --help 2>&1) || true - if echo "${output}" | grep -q "${expected}"; then + if grep -q "${expected}" <<< "${output}"; then echo "PASS: dotnet ${tool} --help" else echo "FAIL: dotnet ${tool} --help did not contain '${expected}'" diff --git a/use-current-runtime/test.sh b/use-current-runtime/test.sh index 86907c7b..a6383ab6 100755 --- a/use-current-runtime/test.sh +++ b/use-current-runtime/test.sh @@ -8,9 +8,7 @@ PORTABLE_RID="$(../runtime-id --portable)" DOTNET_BUILD_OUTPUT=$(dotnet build --use-current-runtime) -# grep -q can exit early, making the other proceses in the pipe report a -# SIGPIPE, so consume the rest of the output with cat to avoid the SIGPIPE -if echo "$DOTNET_BUILD_OUTPUT" | { grep -q "RuntimeIdentifier is $PORTABLE_RID"; cat >/dev/null; } then +if grep -q "RuntimeIdentifier is $PORTABLE_RID" <<< "$DOTNET_BUILD_OUTPUT"; then echo "PASS: --use-current-runtime uses portable rid." else echo "FAIL: --use-current-runtime does not use portable rid."