in reply to Reset STDERR to console
Look at open, search for "OPEN STDERR". There you'll find documented ways to redirect STDOUT and STDERR and later restore them.