preventing readers from absorbing the information.
- Original Message -
From: "Greg Wooledge"
To:
Cc:
Sent:Thu, 29 Jun 2017 15:39:20 -0400
Subject:Re: mapfile doesn't accept input from a pipe
On Thu, Jun 29, 2017 at 03:22:24PM -0400, tetsu...@scope-eye.net
wrote:
> So
On Thu, Jun 29, 2017 at 03:22:24PM -0400, tetsu...@scope-eye.net wrote:
> So I look at this not just as a RTFM issue, it's a pitfall built-in to
> the design of the language, and programmers need to understand a bit
> about the implementation of the language to understand what's going
> on. As such
a pipeline could contain *multiple* built-ins or shell functions
with side-effects for the shell's environment) But I think that's a
difficult direction to pursue, unfortunately, and I'm guessing it's
not one that will happen in Bash... (On the bright side it sounds as
though POSIX
On 6/29/17 12:38 PM, Keith Thompson wrote:
> I suggest that it would be worthwhile to mention this issue in the
> documentation.
"Each command in a pipeline is executed as a separate process (i.e., in
a subshell). See COMMAND EXECUTION ENVIRONMENT for a description of a
subshell environment.
On Thu, Jun 29, 2017 at 6:56 AM, Eduardo A. Bustamante López
wrote:
> On Wed, Jun 28, 2017 at 07:08:27PM -0700, Keith Thompson wrote:
> [...]
>> mapfile REDIRECT < /tmp/input.txt
>> cat /tmp/input.txt | mapfile PIPE
>
> The `mapfile PIPE' is a piece of a pipeline, and as such, it r
On Wed, Jun 28, 2017 at 07:08:27PM -0700, Keith Thompson wrote:
> Description:
> The "mapfile" command works correctly if stdin is redirected
> from a file, but not if it's from a pipe.
This is because each command in a pipeline is executed in its own subshell.
Not a bug.
If you need to r
On Wed, Jun 28, 2017 at 07:08:27PM -0700, Keith Thompson wrote:
[...]
> mapfile REDIRECT < /tmp/input.txt
> cat /tmp/input.txt | mapfile PIPE
The `mapfile PIPE' is a piece of a pipeline, and as such, it runs in a
subshell (different process).
See: http://mywiki.wooledge.org/BashFA
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -g -O2 -Wno-parentheses -Wno-format-security
uname output: Linux bomb20 4.8.0-46-generic #49-Ubuntu SMP Fri Mar 31
13:57:14 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Mac