in reply to Copy multiple lines to a loop
Sounds like you are just missing the final newline when you paste. Paste 3 or more lines to verify that.
There is also a race as to how quickly the output will appear. Well, you wouldn't have this problem on, for example, Windows, as it echos input characters when they are read. Unix echos input characters when they are typed (which is a particularly bad choice when prompting for a password -- but it isn't like Unix is going to change this).
I see no easy way to work around this (unless switching to Windows happens to be easy in your case :). You could turn off echo but you probably want echo in some cases. You could turn off echo, put the tty in raw mode, and emulate echo. That is a lot of work compared to the code you have right now.
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Copy multiple lines to a loop (echo race)
by eyekona (Acolyte) on May 21, 2014 at 07:56 UTC | |
by tye (Sage) on May 21, 2014 at 14:11 UTC |