Example of spying on stdin/stdout