tirnanog 1684896229 learn do_stuff() { command1 >&3; command2; }; { output=$(do_stuff); } 3>&1 # will capture only that which command1 prints to STDOUT, without affecting command2