On Fri, Sep 22, 2017 at 10:03 AM, Greg Wooledge <address@hidden> wrote:
> On Fri, Sep 22, 2017 at 09:54:37AM -0500, John McKown wrote:
> > IFS="" lista=$(cat list)
> > echo $lista
>
> This is also wrong. You MUST QUOTE the variable expansion on line 2.
> That's all. Nothing you do on line 1 matters.
>
​I will agree that your method is superior. However, mine does work. At
least on my Linux system (Fedora 25)
$ IFS="" lista=$(cat list)
$ echo $lista
hello
world
Your solution, as I understand it:
$ lista=$(cat list)
$ echo "$lista"
hello
world
Yet another solution:
$ lista="$(cat list)"
$ echo $lista
hello
world
All of the above are the cut'n'paste from my Linux/Intel system, Linux
it-johnmckown-linux 4.11.12-200.fc25.x86_64 #1 SMP Fri Jul 21 16:41:43 UTC
2017 x86_64 x86_64 x86_64 GNU/Linux
using bash 4.3.43(1)-release
--
*L'Shanah Tovah Tikatevu*
Maranatha! <><
John McKown