Mail Archives: cygwin/1997/01/27/12:30:10
Wayne Davison wrote:
> Is anyone else having trouble with "read" in a /bin/sh script? The code is
> apparently reading extra newlines.
> [ Code deleted ]
> one: two:
> three: four: [User presses return]
> five: six: [User presses return]
> seven: eight: [User presses return]
> done
I've seen different behavior on Windows 95.
Running "bash script" from command.com (win95) or "./script" from bash
gives
one:
two: three: <wait for return>
four: five: <wait for return>
etc.
Running "./script < /dev/tty" gives:
one:
two: <wait for return>
three: <wait for return>
four: <wait for return>
etc.
The first one suggests that someone's shoving a "<cr><nl>" down the pipe
when starting up. Also, when the user hits <return>, a "<cr><nl>" is
being sent that gets interpreted as two EOLs.
The second one suggests that when reading directly from /dev/tty,
somehow, things are being cooked properly (<cr><nl> -> <nl>), but that
the initial <cr><nl> down the pipe is still happening..
--
Shankar Unni shankar AT chromatic DOT com
Chromatic Research (408) 752-9488
-
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 -