> -----Original Message-----
> From: Michael Fowler [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 21, 2001 4:39 PM
> To: Bob Showalter
> Cc: '[EMAIL PROTECTED]'
> Subject: Re: Detecting if a pipe exists
> 
> 
> On Tue, Aug 21, 2001 at 04:06:11PM -0400, Bob Showalter wrote:
> > You might use -t to see if STDIN is a tty, but that 
> wouldn't work for
> > 
> >    $ cat >sq.sh
> >    squareroot 100
> >    $ sh sq.sh          # STDIN is a tty, but should I read input?
> 
> I'm not seeing the purpose behind this example.  You're 
> effectively invoking
> the command from the command-line, but doing it through the 
> extra step of a
> shell script.  Why is checking for a tty on STDIN invalidated by this?

No, you are correct. The check for a tty is not invalidated. I
had turned the problem around in my head, thinking the program
*should* read from STDIN if it is a tty, as well as processing
from @ARGS. Which behaviour might not be intended if the program
were used in a script, but could not be disabled.

My mistake.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to