script > mumble a trap for the unwary
Computer Center
haynes at saturn.ucsc.edu
Sat Oct 1 07:33:02 AEST 1988
Had a user complain that he said
script > filename
and everything locked up and he had to go to another terminal and
kill the job.
Of course what really happened is just that the script program
ran as it should have, and all the output, prompts, etc. went into
the file where he had redirected them. He could have got out of
it by typing a ctrl-D to end the script run.
So - I'm thinking of sticking in something along the lines of
if (!isatty(1))
fprintf(stderr, "Redirecting output may not be what
you have in mind. Type a ctrl-D if you want to start
over.\n");
More information about the Comp.unix.wizards
mailing list