Handle Filenames with Spaces Properly in Bash Loops

find ~ -name '* *' | while read FILE
do
    echo "$FILE rocks."
done

via Handling Filenames with Spaces in Bash


Leave a Comment

(required)

(required)

Formatting Your Comment

The following XHTML tags are available for use:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

URLs are automatically converted to hyperlinks.