[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: builtin read stops at '\0'
From: |
Rafaël Fourquet |
Subject: |
Re: builtin read stops at '\0' |
Date: |
Thu, 19 May 2011 16:30:40 +0200 |
>
> Here's what I'd do: just use tr to swap the delimiters.
>
> while read -d '' -r group; do
> mapfile -t files <<< "$group"
> ...
> done < <(tr '\n\0' '\0\n' < "yourfile")
>
> > I want to pipe each group to xargs -0.
>
> Not what I'd do.
>
Thanks!
But is there something wrong with xargs? or is it my use of "echo ...|xargs"
(I did not know "here strings")
Do you mean, in your example, that e.g.
... do mapfile -t files <<< "$group" ; ls -1 "${files[@]}"; done ...
is better than:
... do xargs -d '\n' ls -1 <<<"$group"; done ...