delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/01/26/13:33:54

From: wayne AT clari DOT net (Wayne Davison)
Subject: Bash bug wth read
26 Jan 1997 13:33:54 -0800 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <01BC0B86.D4EA9D80.cygnus.gnu-win32@wayned.sc.scruznet.com>
Original-To: "'gnu-win32 AT cygnus DOT com'" <gnu-win32 AT cygnus DOT com>
Encoding: 32 TEXT
Original-Sender: owner-gnu-win32 AT cygnus DOT com

Is anyone else having trouble with "read" in a /bin/sh script?  The code is 
apparently reading extra newlines.  When the script starts it will skip 
three prompts, and then one each time after that.  For instance, the 
script:

#!/bin/sh
echo -n "one: "
read ask
echo -n "two: "
read ask
echo -n "three: "
read ask
echo -n "four: "
read ask
echo -n "five: "
read ask
echo -n "six: "
read ask
echo -n "seven: "
read ask
echo -n "eight: "
read ask
echo done

Runs like this:

one: two:
three: four:		[User presses return]
five: six:			[User presses return]
seven: eight:		[User presses return]
done


-
For help on using this list, 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