I would like to simplify the output of a script by suppressing the output of secondary commands that are usually successful.
-q on them hides the output when they occasionally fail, so I have no way of understanding the error. Additionally, these commands log their output on
Is there a way to suppress a command's output only if it succeeds?
For example (but not limited to) something like this:
mycommand | fingerscrossed
If all goes well,
fingerscrossed catches the output and discards it. Else it echoes it to the standard or error output (whatever).