bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error in read implementation and/or documentation


From: Pierre Gaston
Subject: Re: Error in read implementation and/or documentation
Date: Sat, 27 Jul 2013 21:40:20 +0300

On Sat, Jul 27, 2013 at 8:11 PM, Peter Olson <polson136@gmail.com> wrote:
> I was using ^D as an EOF. I guess I should have tried it in other ways. Is
> ^D not the same as EOF? Sorry if that is a noob question. I was able to
> reproduce all of your outputs. I am using xterm as my terminal emulator, if
> that matters.
>
> Peter
^D normally closes the input when you are in cooked mode, but to be
able to read chars one by one you cannot use this mode
read set the terminal mode to cbreak or raw mode ^D stops to be
special and "read"  reads your ^D
if you try with "read -n2" you'll notice that you have to press it
twice and the replies contains 2 control d:
$ read -n 2
^D^D$ printf %q "$REPLY"
$'\004\004'$



reply via email to

[Prev in Thread] Current Thread [Next in Thread]