It's a fair point but I think there may be a reasonable middle-ground,
in which common pitfalls are briefly addressed in TFM, but the manual
doesn't become bogged down with exhaustive detail of every possible
pitfall.
After all, information overload would just become another thing
preventing read
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
I think that when programmers first learn shell programming, this is a
hard piece of information to effectively convey. The Bash
documentation provides the important facts:
- Subshells are quietly and automatically constructed for a variety of
shell programming constructs, including pipelines
- C
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
In the documentation for the "mapfile" builtin command:
'-C'
Evaluate CALLBACK each time QUANTUMP lines are read. The '-c'
option specifies QUANTUM.
"QUANTUMP" should be "QUANTUM".
In the latest sources cloned from git://git.savannah.gnu.org/bash.git, this
occurs in:
b
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