On 09/06/2560 03:44, Geir Hauge wrote:
> Greg already pointed out that this doesn't work.
> 
> You can pick one of these instead:
> 
>     mapfile < "$file"; IFS= foo="${MAPFILE[*]}"; unset -v IFS
> 
> or
> 
>     mapfile < "$file"; printf -v foo %s "${MAPFILE[@]}"
> 
Yes, thanks.
The second one looked interesting, but didn't work. I now have:

mapfile <"$file"; IFS= foo="${MAPFILE[*]}"

(without the unset, as it's in a function where it's harmless)

Reply via email to