How can I test whether a command's output is an empty string without interfering with said output? Example:
command | ???
if [ $? = 0 ] && [ -n "$output_from_command"]; then
...
I'd like that the output from the code above be the same as when running command
.