This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: BASH 4.4 mapfile/readarray/read builtins mis-behaving with pipe [edit] documentation bug
- From: Steven Penny <svnpenn at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Sat, 21 Jul 2018 17:37:54 -0700 (PDT)
- Subject: Re: BASH 4.4 mapfile/readarray/read builtins mis-behaving with pipe [edit] documentation bug
- References: <30b851ee-7144-345c-926d-8a08d9a6a27c@verizon.net>
On Sat, 21 Jul 2018 19:36:38, BloomingAzaleas wrote:
At this time, I do not have a Linux image available to me.
its not that hard to get:
1. http://virtualbox.org
2. http://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid
you saw the same behavior on Fedora, then I suggest the behavior
originates upstream at or close the the GNU source-code level.
the behavior is documented by POSIX. Command grouping example:
$ bash -c 'q=2; (q=3); echo "$q"'
2
and reference:
Execute compound-list in a subshell environment [...] Variable assignments and
built-in commands that affect the environment shall not remain in effect after
the list finishes.
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_04_01
pipe example:
$ bash -c 'q=2; echo 3 | read q; echo "$q"'
2
and reference:
Changes made to the subshell environment shall not affect the shell
environment. [...] Additionally, each command of a multi-command pipeline is
in a subshell environment
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_12
For a doc counter-example, the Open Group doc at
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html
its funny that you list this page, as thats exactly where i got my references.
thanks.
Thank you for your response.
Regards,
UN*X Since '85
finally i would say to stop top posting. for someone who is self declared unix
for 30 years, it seems odd that you cant even run fedora, or adhere to defacto
mailing list etiquette. Cheers.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple