Re: [Help-bash] Is there a way to swap stdout with stderr?
From:
Eduardo A . Bustamante López
Subject:
Re: [Help-bash] Is there a way to swap stdout with stderr?
Date:
Sun, 24 Jul 2016 23:13:13 -0500
User-agent:
Mutt/1.5.20 (2009-12-10)
On Sun, Jul 24, 2016 at 08:49:32PM -0500, Peng Yu wrote:
> Hi, I want to swap stdout and stderr of a command. I.e., I want to
> print the output of stdout to stderr and the output of stderr to
> stdout. Is there is a way to do so?
I'd do something like:
| command 3>&1 1>&2 2>&3
The fd #3 works as a temporary variable to help in the swap.
--
Eduardo Bustamante
https://dualbus.me/