this post was submitted on 22 Nov 2025
651 points (98.7% liked)

Programmer Humor

27673 readers
850 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

founded 2 years ago
MODERATORS
 

cross-posted from: https://lemmy.ml/post/39334581

you are viewing a single comment's thread
view the rest of the comments
[โ€“] SlurpingPus@lemmy.world 3 points 1 week ago* (last edited 1 week ago)

where in your pipe you got a non-null exit code

First thing you want is set -e and set -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.