Warren Mansur said:
>Does anyone know how to detect where the output is going from within a
>script? That is, I want my script behave differently if I do:
Are you asking for a way to detect whether the output is
going to a terminal versus a file? With bash you might say
"help test" and see if the "-t FD" test isn't approximately
what you're looking for. With file descriptors for stdin,
stdout and stderr being 0, 1 and 2 respectively, you'd test
whether stdout was a terminal by saying
if [ -t 1 ]
then
... # Terminal stuff here
else
... # Non-terminal stuff here
fi
*****************************************************************
To unsubscribe from this list, send mail to [EMAIL PROTECTED]
with the text 'unsubscribe gnhlug' in the message body.
*****************************************************************