Skip to content

Commit

Permalink
Fix output to stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
gsf committed Apr 9, 2024
1 parent 6c6154b commit 77e780a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions optout/src/test/resources/check-conf-file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ set -e

# Echo to stderr
err() {
echo 2>&1 "$@"
>&2 echo "$@"
}

conf_file=$1
today=$(date +%Y%m%d)
expected=$(mktemp)

err "Expected file content:"
err

# Use head from gnu coreutils to remove trailing newline
head -c-1 <<EOF | tee 2>&1 "$expected"
head -c-1 <<EOF | >&2 tee "$expected"
HDR_BENECONFIRM${today}
1S00E00JG37${today}NAccepted 00
7SP1D00AA00${today}NAccepted 00
Expand Down

0 comments on commit 77e780a

Please sign in to comment.