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: Peter Olson
Subject: Re: Error in read implementation and/or documentation
Date: Sat, 27 Jul 2013 16:01:17 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7

OK, that makes sense. Sorry for being confused. I thought that by this level, ^D and EOF are equivalent. I should be able to check to see if the character returned is ^D, then act accordingly.

Peter

On 07/27/2013 03:10 PM, Chet Ramey wrote:
On 7/27/13 1:32 PM, Andreas Schwab wrote:
Chris Down <chris@chrisdown.name> writes:

Cannot reproduce.

     $ printf 01 | read -n3
     $ echo $?
     1
Try the same with input from the terminal.
You are reading one character at a time, so ICANON is not set and ^D is an
ordinary character.  It's only `recognized' as EOF when ICANON is set and
the ^D is typed as the only character on a line.

Chet




reply via email to

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