Subject: Extra newline with bash read?
From: [email-masked] (Fabio Somenzi)

30 May 1997 23:04:41 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
References: <[email-masked]>
Reply-To: [email-masked]
X-Mailer: emacs 19.32.1 (via feedmail 5 I) 
Original-To: "Richardson,Anthony" <[email-masked]>
Original-Cc: "'Gnu-Win32 List'" <[email-masked]>
In-Reply-To: <[email-masked]>
Original-Sender: [email-masked]

>>>>> "R" == Richardson,Anthony  <[email-masked]> writes:

 R> My shell scripts that use "read" to get user input aren't working.
 R> Here's a simple example:

 R>  #!/bin/sh echo -n "input a1: " read a1 echo -n "input a2: " read
 R> a2 echo "a1 = " $a1 echo "a2 = " $a2

 R> It doesn't wait for input at "read a2" and a2 doesn't get set.  Is
 R> the "Enter" key being read as a <CR/NL> pair?  Is there a fix?

You may want to try "C-j" instead of "Enter." It's a workaround rather
than a fix.

Fabio

-- 
Fabio Somenzi          | Phone: 303-492-3466
University of Colorado | Fax:   303-492-2758
ECE Dept.              | Email: [email-masked]
Boulder CO 80309-0425  | WWW:   http://vlsi.colorado.edu/~fabio

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".