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.Is there a way to send the same output to both the std output in KSH (like | tee File but with &2 as file) ?I try to have the stream to stdout AND on stderr at the same time (duplicate the output, one on each channel) but without using temporary object (variable or file)I use a temporary variable but try to avoid thisTempo=$(   #all my code with output to stdout and stderr   )echo ${Tempo}echo ${Tempo} >&2Question asked on StackOverflow with suggestion to ask it here
How can I redirect the same message to both stdoud and stderr (without temporary object)
shell;ksh;stdout;stderr
If your system doesn't have /dev/stderr, you can use perl that way:{  your-code  ..} | perl -pe 'print STDERR'perl processes the input one line at a time, so you won't see partial lines there. For instance with code like:printf 'Foo'; sleep 2; printf 'Bar\n'You'll only see FooBar after 2 seconds.Also note that some commands buffer their output when it doesn't go to a terminal, so that may affect the way the output is done.