bug-bash
[Top][All Lists]
Advanced

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

Re: Fwd: read builtin return non-zero status reason


From: Greg Wooledge
Subject: Re: Fwd: read builtin return non-zero status reason
Date: Wed, 24 Feb 2016 09:24:07 -0500
User-agent: Mutt/1.4.2.3i

> > It's the same thing.  "Reached EOF before seeing the delimiter" is the
> > whole, combined reason.
> 
> How can we verify it?
> 
> Stephane Chazelas also have the same opinion with me in his answer
> http://unix.stackexchange.com/a/265484/38906, that's error came from no
> delimiter found.

You're confused.  There is no difference between the two things.  They
are the two sides of the same check.

When read reads from stdin, it will either encounter EOF, or it won't.
If it encounters EOF, it returns nonzero.  If it doesn't encounter EOF,
it looks to see if it found the delimiter character.  If so, it returns
zero.  If not, it continues reading.

That's literally all of the possible outcomes, apart from non-EOF errors.



reply via email to

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