[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Feature Request - Allow mapfile to handle NUL-delimited data
From: |
Maarten Billemont |
Subject: |
Re: Feature Request - Allow mapfile to handle NUL-delimited data |
Date: |
Thu, 19 May 2011 19:44:33 +0200 |
On 13 May 2011, at 20:07, DJ Mills wrote:
> A -0 option, or even an option to use a different field separator, would be
> an
> excellent feature for mapfile. Currently, of course, you can use:
>
> while IFS= read -rd '' file; do array+=("$file"); done
>
> mapfile is considerably faster, however, and I think this would be quite
> handy.
seconded. I'm not sure why it only works for lines. Sure, on the shell data
is often line-based, but more often than that, line-based parsing is bad and
should be done with a safe delimiter rather than \n instead.