help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] (no subject)


From: John McKown
Subject: Re: [Help-bash] (no subject)
Date: Fri, 22 Sep 2017 10:33:00 -0500

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


reply via email to

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