go-pear: Why read < /dev/tty?
| From: | Alexander Skwar | Date: | Wed, 03 Apr 2002 07:31:34 +0000 |
| Subject: | go-pear: Why read < /dev/tty? | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-5179@lists.php.net to get a copy of this message | ||
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@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 @@ -66,7 +66,7 @@ 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 @@ -80,7 +80,7 @@ echo "In what directory do you want to install them?" echo "(note that the path has to be in the include_path of your php.ini)" echo -n "[$prefix/lib/php] : " -read destdir < /dev/tty +read destdir if [ -z "$destdir" ]; then destdir="$prefix/lib/php" fi @@ -90,7 +90,7 @@ fi echo -n "Do you want to install also the common PEAR files? [Y/n] : " -read installall < /dev/tty +read installall files="/" if [ `echo $installall | grep -i 'n'` ]; then files="/scripts/pear.in /Archive/Tar.php /Console/Getopt.php /PEAR.php /System.php /PEAR" @@ -149,3 +149,4 @@ echo exit +
--- go-pear Wed Apr 3 09:25:58 2002 +++ go-pear.without-dev-tty Wed Apr 3 09:26:39 2002 @@ -66,7 +66,7 @@ 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 @@ -80,7 +80,7 @@ echo "In what directory do you want to install them?" echo "(note that the path has to be in the include_path of your php.ini)" echo -n "[$prefix/lib/php] : " -read destdir < /dev/tty +read destdir if [ -z "$destdir" ]; then destdir="$prefix/lib/php" fi @@ -90,7 +90,7 @@ fi echo -n "Do you want to install also the common PEAR files? [Y/n] : " -read installall < /dev/tty +read installall files="/" if [ `echo $installall | grep -i 'n'` ]; then files="/scripts/pear.in /Archive/Tar.php /Console/Getopt.php /PEAR.php /System.php /PEAR" @@ -149,3 +149,4 @@ echo exit +