bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: easier construction of arrays


From: Mike Frysinger
Subject: Re: easier construction of arrays
Date: Thu, 27 Mar 2014 18:05:53 -0400
User-agent: KMail/4.12.3 (Linux/3.13.0; KDE/4.12.3; x86_64; ; )

On Thu 27 Mar 2014 19:15:13 Pierre Gaston wrote:
> On Thu, Mar 27, 2014 at 5:53 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> > On Thu 27 Mar 2014 08:01:45 Greg Wooledge wrote:
> > > files=()
> > > while IFS= read -r -d '' file; do
> > > 
> > >   files+=("$file")
> > > 
> > > done < <(find . -iname '*.mp3' ! -iname '*abba*' -print0)
> > 
> > i've seen this construct duplicated so many times :(.  i wish we had a
> > native
> > 
> > option for it.  maybe something like:
> >         read -A files -r -d '' < <(find . -iname '*.mp3' -print0)
> > 
> > perhaps there is another shell out there that implements something that
> > can replace that loop that bash can crib ?
> 
> An option to change the delimiter for readarray/mapfile?

thanks, i wasn't aware of that func.  that seems like the easiest solution.
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]