Re: Spaces in file names
- From: Dan Mills <dmills@xxxxxxxxxxxxxxxxxxxx>
- Date: 31 Dec 2007 02:41:07 GMT
On Sun, 30 Dec 2007 19:31:45 -0600, Leslie Rhorer wrote:
OK, here's the problem. I need to automatically manipulate the file names
of a number of files whose filenames have spaces in them.
for file in `ls -1 *`
do
<do stuff>
done
How about something like (untested):
#!/bin/bash
IFS=$'\n'
#IFS is the internal field separator in bash and
#here we set it to be new line only.
for file in $(find . -type f)
do
<stuff with "$file">
done
HTH.
Regards, Dan.
.
- Follow-Ups:
- Re: Spaces in file names
- From: Leslie Rhorer
- Re: Spaces in file names
- References:
- Spaces in file names
- From: Leslie Rhorer
- Spaces in file names
- Prev by Date: Re: Spaces in file names
- Next by Date: Re: Spaces in file names
- Previous by thread: Re: Spaces in file names
- Next by thread: Re: Spaces in file names
- Index(es):
Relevant Pages
|