Alexander Skwar | 3 Apr 2002 09:31
X-Face

go-pear: Why read < /dev/tty?

Hi!

I'm right now checking out go-pear and found that it does "read <
/dev/tty".  This will make the script be "unscriptable", that is, I
cannot pipe default values to it.  And I also don't understand why it
does this in the first place.  read defaults to reading from stdin and
stdin is mostly /dev/tty, isn't it?

Attached you find a patch that removes the "< /dev/tty" parts.

Alexander Skwar
--

-- 
How to quote:	http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:	http://www.iso-top.de      |     Jabber: askwar <at> charente.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
                       Uptime: 1 day 20 hours 28 minutes
--- go-pear	Wed Apr  3 09:25:58 2002
+++ go-pear.without-dev-tty	Wed Apr  3 09:26:39 2002
 <at>  <at>  -66,7 +66,7  <at>  <at> 

 echo "Which file name do you want for the 'pear' executable?"
 echo -n "[$TARGET] : "
-read destpearin < /dev/tty
+read destpearin
 if [ ! -z "$destpearin" ]; then
 	TARGET=$destpearin
 fi
 <at>  <at>  -80,7 +80,7  <at>  <at> 
(Continue reading)

Tomas V.V.Cox | 3 Apr 2002 11:01

Re: go-pear: Why read < /dev/tty?

Alexander Skwar wrote:
> 
> Hi!
> 
> I'm right now checking out go-pear and found that it does "read <
> /dev/tty".  This will make the script be "unscriptable", that is, I
> cannot pipe default values to it.  And I also don't understand why it
> does this in the first place.  read defaults to reading from stdin and
> stdin is mostly /dev/tty, isn't it?

It can't read from stdin as this channel is already handling the data
comming from the pipe (lynx ... | sh). For making it a real command we
should just add params.

Tomas V.V.Cox

--

-- 
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Gmane