Skip site navigation (1)Skip section navigation (2)
Date:      16 Oct 2020 13:53:02 -0400
From:      "John Levine" <>
Subject:   Re: sh scripting question
Message-ID:  <20201016175302.CFDB2238515F@ary.qy>
In-Reply-To: <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
In article <> you write:
>On Thu, Oct 15, 2020 at 8:40 PM Robert Huff <> 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)

This is the sensible answer.  Messing with IFS is very fragile.

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

The "read" command can set more than one variable so

while read a b c
done < files.list

will set $a to the first word on each line, $b to the second, $c to
the rest of the line, which looks like what you wanted to do here.

Want to link to this message? Use this URL: <>