On Fri, 7 Jun 2002, at 2:00pm, [EMAIL PROTECTED] wrote: > Ahm, I don't think you can, since the shell is sending to STDOUT in this > case, and STDOUT has been redirected at *shell* level to be someplace > other than STDOUT; in this case, a file.
STDOUT is simply file descriptor 1. (STDIN is FD 0, STDERR is FD 2.) All a shell does when it sets up redirection is close the appropriate FD, and then re-open it on another file (using the dup2(2) system call (I think)). The program being redirected simply outputs to the appropriate FD. As Michael O'Donnell points out, you can use the -t "test" to determine if a FD number is a tty or not. I expect that simply makes use of the "isatty(3)" library call. -- Ben Scott <[EMAIL PROTECTED]> | The opinions expressed in this message are those of the author and do not | | necessarily represent the views or policy of any other person, entity or | | organization. All information is provided without warranty of any kind. | ***************************************************************** To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *****************************************************************
