On Wed, Aug 22, 2001 at 11:09:13AM +0530, Karthik Krishnamurthy wrote:
> wouldn't it be better to check ARGV to see if arguments have been
> passed. if input. else read on STDIN.
You missed his last example:
On Tue, Aug 21, 2001 at 03:44:05PM -0400, Andrew G.McArthur wrote:
> cat numbers.list |
wouldn't it be better to check ARGV to see if arguments have been passed. if so use
that as
input. else read on STDIN.
/kk
On Tue, Aug 21, 2001 at 12:10:22PM -0800, Michael Fowler wrote:
> On Tue, Aug 21, 2001 at 03:44:05PM -0400, Andrew G.McArthur wrote:
> > > squareroot 100 1000 25
> >
> >
> -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, B
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'
On Tue, Aug 21, 2001 at 03:44:05PM -0400, Andrew G.McArthur wrote:
> > squareroot 100 1000 25
>
> > cat numbers.list | squareroot
>
> > cat numbers.list | squareroot 25 144
>
> I've had no problem with the second two examples, but the first waits
> for input from the STDIN. How can I get m
> -Original Message-
> From: Andrew G.McArthur [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 21, 2001 3:44 PM
> To: [EMAIL PROTECTED]
> Subject: Detecting if a pipe exists
>
>
> Dear all,
>
> I'm developing a perl program in UNIX that I want t
Dear all,
I'm developing a perl program in UNIX that I want to sometimes work on
data from the pipe, sometimes from the command line, and sometimes
both. For example, consider the hypothetical program "squareroot". I
would like to use it in the following three ways from the command prompt: