From: ara.t.howard@... Date: 2006-09-28T06:55:02+09:00 Subject: Re: how to determine if pipe is given On Thu, 28 Sep 2006 gwtmp01@mac.com wrote: > > On Sep 27, 2006, at 4:42 PM, ara.t.howard@noaa.gov wrote: >> consider i have many, many programs which do things like >> >> convert infile outfile >> convert - outfile # infile on stdin >> convert infile - # outfile on stdout >> convert - - # infile on stdin, outfile on stdout >> convert --infiles=- # list of infiles on stdin, auto-name outfiles > > While I understand the historical reason for such constructs, I much prefer: > > convert infile outfile > convert /dev/stdin outfile # infile on stdin > convert infile /dev/stdout # outfile on stdout > convert # infile on stdin, outfile on stdout agreed. > >> convert --infiles=- # list of infiles on stdin, auto-name >> outfiles > > Not sure about this last one. It certainly isn't all that common. You can > get close to this via: harp:~ > printf "stdin\nstdout\nstderr\n" | grep -i -f- a.rb STDERR.puts "#{ msg } (#{ tid })" STDIN.gets we have lots of code that does this because they take thousands of infiles, hdrfiles, etc... cheers. -a -- in order to be effective truth must penetrate like an arrow - and that is likely to hurt. -- wei wu wei