I'm trying to write a script that's robust enough to work with spaces.
Its currently in a for loop, but the problem I'm having is folders with spaces in its name.
ASOURCE="Home Photos 2012 camcorder" #example filename if [ -d "$(echo $ASOURCE)" ] # If directory exists then #command else echo "File does not exist: " $1 #Error echo "DIR :" $(echo $ASOURCE | sed 's/\ /\\ /g') fi
It fails on the the verification. I've tried pre-escaping the spaces, but to no avail