Path: csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Greg Wooledge Newsgroups: gnu.bash.bug Subject: Re: [mapfile]: problem reentrance with normal file Date: Mon, 12 Nov 2018 08:55:17 -0500 Lines: 12 Approved: bug-bash@gnu.org Message-ID: References: NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: usenet.stanford.edu 1542030959 21986 208.118.235.17 (12 Nov 2018 13:55:59 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-bash@gnu.org, bash@packages.debian.org To: Didou Serge Envelope-to: bug-bash@gnu.org Mail-Followup-To: Didou Serge , bug-bash@gnu.org, bash@packages.debian.org Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 139.137.100.1 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:14794 On Sun, Nov 11, 2018 at 09:32:31PM +0100, Didou Serge wrote: > When use mapfile from normal file that call function that use mapfile, the > first mapfile lost data. > > Repeat-By: > I create 3 functions: > ww(){ echo "$@" | mapfile -C yy -c 1 -t TT ; } In this function, mapfile is being executed in a subshell. It will read the input, and then when the subshell terminates, the array will be discarded.