Tech
A control that had genuinely failed printed exit 0, because I read its status through a pipe
Here are three runs of the same command against the same missing file, measured on 2026-09-04 in bash on Windows.
$ node tools/antiai_gate.mjs --file /nonexistent-xyz.md > /dev/null 2>&1 ; echo $?
1
$ node tools/antiai_gate.mjs --file /nonexistent-xyz.md 2>&1 | tail -1 > /dev/null ; echo $?
0
$ node tools/antiai_gate.mjs --file /nonexistent-xyz.md 2>&1 | tail -1 > /dev/null ; echo ${ PIPESTATUS [0] }
1
...
Read the full discussion on Dev.to
This article was aggregated from Dev.to. Click to join the conversation.
View on Dev.to