in reply to script and its output on different handles

At least on Unix, there is a utility called tee which helps you to print to the screen and to a file simultaneously.