close STDOUT; #close the original STDOUT tee to file open (STDOUT, ">/dev/tty"); #open STDOUT back to just the terminal system("$y", "$u"); #my $rhup = `"$y" "$u"`; my $err = $?>> 8; open (STDOUT, "|tee -ai /var/tmp/IQOQ.txt"); #Now re-tee STDOUT since we aren't done