On Wed, Aug 5, 2009 at 11:12 AM, Mel
Flynn<mel.flynn+fbsd.questi...@mailing.thruhere.net> wrote:
> On Wednesday 05 August 2009 07:00:40 Glen Barber wrote:
>> On Wed, Aug 5, 2009 at 3:36 AM, Matthew
>>
>> Seaman<m.sea...@infracaninophile.co.uk> wrote:
>> > Try this as:
>> >
>> >    for line in $( cat $FILELIST ) ; do
>> >        echo $line
>> >        find $line -type f >> $TMPFILE
>> >    done
>> >
>> > *assuming that none of the directory names in $FILELIST contain spaces*
>>
>>    for line in $( cat $FILELIST | sed -e 's/\ //g') ; do
>>        echo $line
>>        find $line -type f >> $TMPFILE
>>    done
>>
>> This *should* fix any directories containing spaces.
>
> And also make find look in non-existing directories.

True, but any script that needs to find directories containing spaces
is going to be hack-ish.

for line in $( cat $FILELIST | sed -e 's/\ /SPACE/g') ; do
   echo $line | sed -e 's/SPACE/\ /g'
   find $line -type f >> $TMPFILE
done

-- 
Glen Barber
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to