[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trailing newlines disappear

From: PePa
Subject: Re: Trailing newlines disappear
Date: Fri, 9 Jun 2017 03:34:39 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1

On 09/06/2560 02:14, Greg Wooledge wrote:
> Well, it leaves IFS changed, because you didn't revert or unset it,
> or run the entire thing in a function with local IFS.  Also, I'd use
> "${MAPFILE[*]}" to reinforce that you are joining an array into a string,
> rather than expanding the array as a list.

Thanks for pointing all this out. I settled on:
mapfile <"$file"; IFS= foo=${MAPFILE[*]} true

Again, much faster than a subshell. Are there order guarantees in the
case of "a=x b=y command"??


reply via email to

[Prev in Thread] Current Thread [Next in Thread]