Using exec ((for all sorts of redirections)) @ TLDP.org, Advanced Bash Scripting - 0 views
-
Fabien Cadet on 25 Aug 14Save STDOUT + redirect it to STDERR : exec 6>&1 1>&2 Do some output, everything goes to STDERR. Restore STDOUT from FD 6 and close FD 6: exec 1>&6 6>&- Anything now goes back to the original STDOUT.