sh scripting question

Rick Miller vrwmiller at gmail.com
Fri Oct 16 01:31:08 UTC 2020


On Thu, Oct 15, 2020 at 8:40 PM Robert Huff <roberthuff at 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


More information about the freebsd-questions mailing list