From: earnie_boyd AT yahoo DOT com (Earnie Boyd) Subject: Re: BASH read gives extra end of lines 7 Jun 1998 17:27:27 -0700 Message-ID: <19980607153407.1902.rocketmail.cygnus.gnu-win32@send1d.yahoomail.com> Reply-To: earnie_boyd AT yahoo DOT com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: gnu-win32 AT cygnus DOT com, Erik Pessers It's a bug that hasn't been resolved as yet. Use ^Z or ^J to enter the data instead of enter. ---Erik Pessers wrote: > > Hi, > > I have a problem I hope some-one can help me solving. > > When executing a BASH script from the BASH shell (B19) on my Windows95 > PC, I get extra end of lines on a BASH "read" command.. > > So, in a script like > > > > echo -n "[Var 1] : " > > read var1 > > echo -n "[Var 2] : " > > read var2 > > echo -n "[Var 3] : " > > read var3 > > echo -n "[Var 4] : " > > read var4 > > echo " Var 1 = $var1 ; Var 2 = $var2" > > > > echo " Var 3 = $var3 ; Var 4 = $var4" > > > > > > I fail to enter data for $var2: when entering a response to the first > read, > I seem to generate an extra that is read on the second query. > The second "read" for $var2 is "automatically" answered, and $var2 > is effectively empty. > > I can then again enter a response for $var3; and get an extra > to leave me with an empty $var4. > > I tried terminating a response with just CTRL-J, but this did not solve > the issue. > > When executing the same script under Linux/Bash rather than Win95/Cygwin > bash, > it runs OK. > > I scanned the mailing list archive, and found this question being > asked several times, but I could not find a solution. > > Can anyone please help me in this? The problem as it is prevents me > from eg. executiong "sh configure" scripts, which is quite annoying. > > Thanks in advance ! > > -- > > > Cheers, Erik > > >
Hi,

I have a problem I hope some-one can help me solving.

When executing a BASH script from the BASH shell (B19) on my Windows95
PC, I get extra end of lines on a BASH "read" command..

So, in a script like
 

echo -n "[Var 1] : "
read var1
echo -n "[Var 2] : "
read var2
echo -n "[Var 3] : "
read var3
echo -n "[Var 4] : "
read var4
echo " Var 1 = $var1 ; Var 2 = $var2"
echo " Var 3 = $var3 ; Var 4 = $var4"
 

I fail to enter data for $var2: when entering a response to the first read,
I seem to generate an extra that is read on the second query.
The second "read" for $var2 is "automatically" answered, and $var2
is effectively empty.

I can then again enter a response for $var3; and get an extra
to leave me with an empty $var4.

I tried terminating a response with just CTRL-J, but this did not solve the issue.

When executing the same script under Linux/Bash rather than Win95/Cygwin bash,
it runs OK.

I scanned the mailing list archive, and found this question being
asked several times, but I could not find a solution.

Can anyone please help me in this? The problem as it is prevents me
from eg. executiong "sh configure" scripts, which is quite annoying.

Thanks in advance !

--
 

Cheers, Erik
 
  _________________________________________________________ DO YOU YAHOO!? Get your free @yahoo.com address at http://mail.yahoo.com - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".