I think its the case that you can't just assign the stdout to stderr because other things might have already cached (?) stdout by the time the reassignment takes place.
So how do I do this (using Linux)?
Understanding the concept of redirections and file descriptors is very important when working on the command line. To redirect stderr and stdout , use the 2>&1 or &> constructs.
The Linux Standard StreamsText output from the command to the shell is delivered via the stdout (standard out) stream. Error messages from the command are sent through the stderr (standard error) stream. So you can see that there are two output streams, stdout and stderr , and one input stream, stdin .
To redirect the stdout to stderr, use your command as follows :-
$ command-name 1>&2
where command-name
is the command you're going to feed, 1 represents stdout
and 2 represents stderr
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With