[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Trailing newlines disappear
From: |
Peter & Kelly Passchier |
Subject: |
Re: Trailing newlines disappear |
Date: |
Fri, 9 Jun 2017 03:54:08 +0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 |
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)
- Trailing newlines disappear, PePa, 2017/06/08
- Re: Trailing newlines disappear, Greg Wooledge, 2017/06/08
- Re: Trailing newlines disappear, Peter & Kelly Passchier, 2017/06/08
- Re: Trailing newlines disappear, PePa, 2017/06/08
- Re: Trailing newlines disappear, Geir Hauge, 2017/06/08
- Re: Trailing newlines disappear,
Peter & Kelly Passchier <=
- Re: Trailing newlines disappear, Greg Wooledge, 2017/06/08
- Re: Trailing newlines disappear, Eduardo Bustamante, 2017/06/08
- Re: Trailing newlines disappear, Peter & Kelly Passchier, 2017/06/08
- Re: Trailing newlines disappear, Greg Wooledge, 2017/06/09
- Re: Trailing newlines disappear, Chet Ramey, 2017/06/09
- Re: Trailing newlines disappear, Greg Wooledge, 2017/06/09
- Re: Trailing newlines disappear, Chet Ramey, 2017/06/09
- Re: Trailing newlines disappear, L A Walsh, 2017/06/09
- Re: Trailing newlines disappear, Peter & Kelly Passchier, 2017/06/09
- Re: Trailing newlines disappear, Pierre Gaston, 2017/06/09