It is easy to redirect stdout or stderr to the same output (file or one of the 2 std output) with a 1>&1
,>&2
and/or >file
but is there a way to send the same output to both the std output in KSH (like | tee File
but with &2
as file) ?
How can I redirect the same message to both stdoud and stderr (without temporary file)
78 views Asked by NeronLeVelu At
2
There are 2 answers
0
On
Response on Unix & Linux
Post: How can I redirect the same message to both stdoud and stderr (without temporary object)
by Stéphane Chazelas
{ your-code } | perl -pe 'print STDERR'
Edited: replaced [read] and [echo] by [read -r] and [print]