This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
B19.1: bash/sh/ash "read" bug
- To: "'gnu-win32 at cygnus dot com'" <gnu-win32 at cygnus dot com>
- Subject: B19.1: bash/sh/ash "read" bug
- From: Charles Randall <crandall at matchlogic dot com>
- Date: Tue, 28 Jul 1998 22:26:13 -0600
- Cc: "'cfr at pobox dot com'" <cfr at pobox dot com>
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".