Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Oct 2020 21:30:54 -0400
From:      Rick Miller <vrwmiller@gmail.com>
To:        Robert Huff <roberthuff@rcn.com>
Cc:        FreeBSD questions <questions@freebsd.org>
Subject:   Re: sh scripting question
Message-ID:  <CAHzLAVGS_8kXtWoP3TfpTtz-zP57rpYEKrx3L089=eRRszsY-Q@mail.gmail.com>
In-Reply-To: <24456.60388.135834.43951@jerusalem.litteratus.org>
References:  <24456.60388.135834.43951@jerusalem.litteratus.org>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Thu, Oct 15, 2020 at 8:40 PM Robert Huff <roberthuff@rcn.com> wrote:

>
>         I have a file ("files.list") with a list of filenames, similar to
>
>         /path A/path B/FreeBSD is great.txt
>
>         (note the embedded spaces)
>         If I use
>
>         for FILE in `cat files.list`
>
>         FILE will be set to "/path".
>         How do I get it to read the entire string?
>         Or am I using the wrong tool?
>

$ cat f.in
/path A/path B/FreeBSD is great.txt
/path T/path Q/FreeBSD rocks.txt
$ while read line; do
> echo $line
> done < f.in
/path A/path B/FreeBSD is great.txt
/path T/path Q/FreeBSD rocks.txt

-- 
Take care
Rick Miller



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?CAHzLAVGS_8kXtWoP3TfpTtz-zP57rpYEKrx3L089=eRRszsY-Q>