B19.1: bash/sh/ash "read" bug
Charles Randall
crandall@matchlogic.com
Wed Jul 29 11:01:00 GMT 1998
The "read" builtin in bash/sh/ash doesn't seem to be functioning
properly. I suspect this has to do with newline processing on
stdin.
Anyway, consider the following test script (named test.sh):
/bin/echo "Q1 - [y/n] \c"
read ans
/bin/echo "ans=[$ans]"
/bin/echo "Q2 - [y/n] \c"
read ans
/bin/echo "ans=[$ans]"
/bin/echo "Q3 - [y/n] \c"
read ans
/bin/echo "ans=[$ans]"
With bash/sh/ash, I always get the following behavior:
bash-2.01$ bash ./test.sh
Q1 - [y/n] y
ans=[y]
Q2 - [y/n] ans=[]
Q3 - [y/n] y
ans=[y]
The second "read" returns nothing as if a newline had been entered.
I've tryed just entering "y" followed by either ^J or ^M as a guess.
That didn't work either.
Same behavior with or without the " \c" in the echo command.
This makes configuring Perl a real joy -- I only get a chance
to answer every other question from Configure. :^(
Suggestions? (I'm not interested in a binary distribution of Perl)
Charles
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
More information about the Cygwin
mailing list