delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/05/30/17:24:47

From: ARichard AT stark DOT cc DOT oh DOT us ("Richardson,Anthony")
Subject: Extra newline with bash read?
30 May 1997 17:24:47 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199705301343.JAA06726.cygnus.gnu-win32@dialup.oar.net>
Original-To: "'Gnu-Win32 List'" <gnu-win32 AT cygnus DOT com>
X-Mailer: Worldtalk (NetConnex V4.00)/MIME
Original-Sender: owner-gnu-win32 AT cygnus DOT com

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

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

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

Thanks,
Tony Richardson
arichard AT stark DOT cc DOT oh DOT us
-
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".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019