2018 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu
Bash Version: 5.0
Patch Level: 0
Release Status: release
Cuong Manh Le
https://cuonglm.xyz
> On Wed, Feb 24, 2016 at 11:31:40AM +0700, Cuong Manh Le wrote:
> > > I send this email to help-bash but it seems to be inactive. Please
> help me
> > > with this problem. Thanks.
> >
> > help-bash is active. You probably just didn't wait long enough.
>
Why there's no different? EOF means you have nothing to read.
If you put it into a while loop context:
while read -d '' line; do echo "$line"; done < <(printf '1')
give you nothing. There's only one read in this case
There's data to read, but read return non-zero there. it doesn't find
delimit
limiter found.
IMHO, it will be better if bash can return different status code for two
cases.
Thanks.
On Wed, Feb 24, 2016 at 8:37 PM, Greg Wooledge wrote:
> On Wed, Feb 24, 2016 at 11:31:40AM +0700, Cuong Manh Le wrote:
> > I send this email to help-bash but it seems to be inactive.
I send this email to help-bash but it seems to be inactive. Please help me
with this problem. Thanks.
-- Forwarded message --
From: Cuong Manh Le
Date: Wed, Feb 24, 2016 at 11:14 AM
Subject: read builtin return non-zero status reason
To: help-b...@gnu.org
The bash read builtin
readonly var=value prevent shell scripter changing value of variable var,
there is no restriction for the shell itself.
Try:
set -o posix
readonly | grep SHELLOPTS
and:
set +o posix
readonly | grep SHELLOPTS
to see the missing of `posix` in 2nd command, the readonly variable
SHELLOPTS was