More robust shell script: allow spaces in directory names.