Mail Archives: djgpp/1998/03/25/03:11:58
On Mon, 23 Mar 1998, Ned Ulbricht wrote:
> bash$ cat -
>
> then after terminating the input with ^Z (either keyboard ctrl-Z or F6),
> subsequent cat's from stdin
>
> bash$ cat -
>
> result in cat returning immediately without accepting input.
Confirmed.
> It seems to me that this is likely caused by the ^Z remaining buffered
> somewhere in the input stream and being resent to cat on the subsequent
> invocations under bash.
Yep, that's what's probably going on. The question is: what does Bash
do to cause this? I'm afraid the answer is in the sources of the
ported Bash. I looked at the sources of `cat' and tried to understand
what would cause this, but didn't see anything. (Curiously, other
similar programs, like `tac', don't have this problem.) In any case,
if ^Z is left in the stream, it's Bash's stream, since `cat' exits and
its buffers are flushed.
- Raw text -