[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bash scripts and multi-word filenames



Hi, 

I keep running into this particular gap in my scripting, and hope someone can 
clear it up for me.  

FILES=$( ls SOMEWHERE )  #or find or grep, etc

for FILE in $FILES; do SOMETHING; done

I often find that if there are spaces in the names of anything in $FILES, the 
execution of SOMETHING occurs separately for each word in the name, producing 
unexpected results.

Quoting doesn't seem to help. Are there ways to deal with this?

Thanks,

John



Reply to: