Re: "read" builtin: timeout vs. EOF

2011-12-19 Thread Eric Blake
On 12/18/2011 09:45 AM, Stephen Gildea wrote: > The "read" built-in documentation says, > > Exit Status: > The return code is zero, unless end-of-file is encountered, read times > out, > or an invalid file descriptor is supplied as the argument to -u. > > I would like to be able to d

Re: "read" builtin: timeout vs. EOF

2011-12-19 Thread Chet Ramey
On 12/18/11 11:45 AM, Stephen Gildea wrote: > The "read" built-in documentation says, > > Exit Status: > The return code is zero, unless end-of-file is encountered, read times > out, > or an invalid file descriptor is supplied as the argument to -u. > > I would like to be able to dis

Re: "read" builtin: timeout vs. EOF

2011-12-19 Thread Stephen Gildea
> The documentation already says "the exit status is greater than > 128 if the timeout is exceeded" in a couple of places. Oh, look at that, a mere four lines above the text I quoted. I guess I can downgrade this to a documentation request. > Does it really need to be

segfault expanding certain arrays created via read -N directly to an array.

2011-12-19 Thread Dan Douglas
Hi, This seems to corrupt the array in a way that crashes when trying to expand the array. Also occurs with the previous patchset. ~ $ ( while read -rn 1 'x[y++]'; do :; done < <(printf '%s\n' {0..5}); declare -p x; echo "${x[@]}" ) declare -a x='([0]="0" [1]="" [2]="1" [3]="" [4]="2" [5]="" [6]

Re: Problem with overridden functions and BASH_SOURCE Array

2011-12-19 Thread dethrophes
> The difference between main1 and main2 is the fact that bash always reads > an entire command before executing any of it, and the if statement is a > compound command. Ok that insight gives me a way to work around the problem thanks. > I will have to see if the function definition can do a b

Re: Problem with overridden functions and BASH_SOURCE Array

2011-12-19 Thread Chet Ramey
On 12/19/11 9:22 AM, dethrophes wrote: > >> I will have to see if the function definition can do a better job of >> carrying around the source file and line information, but that's a pretty >> significant change. > Actually from what I have seen it already seems to work for BASH_LINENO. Its > jus

Re: "read" builtin: timeout vs. EOF

2011-12-19 Thread Chet Ramey
> > Does it really need to be in the help text, which is > > just a short reminder reference, as well? > > I think info about how "read -t" exits should be _moved_ from under > the -t discussion to the Exit Status section. Right now there is > complete documentation in one

Re: segfault expanding certain arrays created via read -N directly to an array.

2011-12-19 Thread Chet Ramey
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/19/11 11:12 AM, Dan Douglas wrote: > Hi, This seems to corrupt the array in a way that crashes when trying to > expand the array. Also occurs with the previous patchset. > > ~ $ ( while read -rn 1 'x[y++]'; do :; done < <(printf '%s\n' {0..5});