Replacing white spaces in filename

Hi;
In following code

find LOG_DIR -type f | while read filename; do echo $filename; done

I want to precede each white space encountered in filename with \ so that when i use $filename for running some commands in do...done,it wont give me an error.

will appreciate ur help in this.
thanks;

find LOG_DIR -type f | while read filename; do echo "$filename"; done
1 Like