The argument-validation checks in entry.sh print their failure messages to stdout, not stderr.
At entry.sh:10:
echo "The first argument must be the ID of the job to process"
exit 1
and the same pattern repeats at entry.sh:16 for the missing-home check. Both branches exit 1 on the next line, but the diagnostic line is written to file descriptor 1.
A caller that runs entry.sh ... 2>/dev/null or pipes the script's stdout into another stage gets a silent failure: stderr stays empty, stdout carries a sentence the next stage interprets as data. The same script enables set -ex on entry.sh:5, which sends the shell trace to stderr by convention; mixing diagnostic output between the two streams forces every caller to special-case which fd carries which kind of message.
Fix: redirect both echo calls to stderr — echo "..." >&2 on entry.sh:10 and entry.sh:16.
The argument-validation checks in
entry.shprint their failure messages to stdout, not stderr.At
entry.sh:10:and the same pattern repeats at
entry.sh:16for the missing-home check. Both branchesexit 1on the next line, but the diagnostic line is written to file descriptor 1.A caller that runs
entry.sh ... 2>/dev/nullor pipes the script's stdout into another stage gets a silent failure: stderr stays empty, stdout carries a sentence the next stage interprets as data. The same script enablesset -exonentry.sh:5, which sends the shell trace to stderr by convention; mixing diagnostic output between the two streams forces every caller to special-case which fd carries which kind of message.Fix: redirect both
echocalls to stderr —echo "..." >&2onentry.sh:10andentry.sh:16.