[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] How to set IFS temporarily? (along with assignment and a
From: |
Eric Blake |
Subject: |
Re: [Help-bash] How to set IFS temporarily? (along with assignment and array initiation) |
Date: |
Mon, 16 Mar 2015 13:09:00 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 |
On 03/16/2015 12:45 PM, Chet Ramey wrote:
> On 3/16/15 12:57 PM, Greg Wooledge wrote:
>> On Mon, Mar 16, 2015 at 11:49:46AM -0500, Peng Yu wrote:
>>> I'm trying to understand readarray. It can only separate elements by
>>> newline. What about separating the elements by $'\0'? Is there an
>>> option for this case (I don't find it in the man page)?
>>
>> Unfortunately, no. That's one of my top wishlist features. If you
>> want to read elements delimited by anything other than \n you have to
>> use a loop.
>
> Look at the devel branch. mapfile/readarray acquired a `-d delim' option
> in early July, 2015.
Amazing - a patch from the future. Can you share your time machine
tricks with the rest of us? :)
[Obviously that's from 2014; I found it in commit 25a0eacf]
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature