[bash] Assign function result to var without suppressing it's stdout

You can output to stdout (>&1) and stderr (>&2). On the terminal both go to terminal by default.

If you do

  result=$(CLI ...)

then result gets the output of stdout only (unless you redirected stderr…), and stderr output goes to terminal.

Hope this is what you are trying to do. :smile:

1 Like