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 12:11:51 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7

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

On 07/27/2013 10:35 AM, Chris Down wrote:
Hello,

On 27 July 2013 06:37, Peter Olson <polson136@gmail.com> wrote:
If read is invoked with the -n or -N options, then given an EOF, it returns
with a zero exit status.
Cannot reproduce.

     $ echo $BASH_VERSION
     4.2.45(2)-release
     $ read -n1 </dev/null
     $ echo $?
     1
     $ read -N1 </dev/null
     $ echo $?
     1

In addition, if it is invoked with -n 3, for example, then given EOF for one
of the first 2 characters, it still waits for all 3 characters.
Cannot reproduce.

     $ printf 01 | read -n3
     $ echo $?
     1

Best,

Chris




reply via email to

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