Bash script not playing nice with spaces.
I need my bash script to be able to properly work with files/folders that have spaces in them.
The script below does exactly what I need to do to if there are no spaces in file or folder names. When it encounters a space, it treats everything after it as a seperate argument.
I've been hunting high and low for answers, and my google-fu has nothing left.
#!/bin/bash
export VAR=$(find /disk -type d -name "My Files")
for i in "$VAR" ; do
rsync -avR $i /iscsi;
rm -r $i;
ln -s /iscsi/$i $i;
done
If anyone know of a better way to do this, I'm open to suggestions.
Mac OS X (10.7.2)