this post was submitted on 22 Nov 2025
608 points (98.6% liked)
Programmer Humor
28154 readers
711 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
First thing you want is
set -eandset -o pipefail. That should report the errors in human-parseable form.Second, to capture exit codes from each command/program, you have to run each of them in sequence yourself, connected by pipes that you create via
mkfifoโ the same way as you would do it in any other programming environment. Bash's|pipes are just a convenient shorthand for this, so if you want full control, you have to ditch the convenience.