[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] bash question
- Subject: [ale] bash question
- From: mhirsch at nubridges.com (Michael D. Hirsch)
- Date: Tue, 22 Jul 2003 09:06:41 -0400
On Tuesday 22 July 2003 01:30 am, Kevin Krumwiede wrote:
> I want to do something to all the files whose names are listed in a text
> file, like this:
>
> for fname in $(cat filelist); do ...; done
>
> The problem is, some of the file names have spaces. For example, 'My
> Song.mp3'. The action is performed on 'My', and then on 'Song.mp3'.
> How do I make it so each line of the file list is treated as a single
> word?
Use the read command:
while read fname; do cp "$fname" /tmp; done < filelist
Michael
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale