#!/bin/bash export START=`pwd` for DIR in `find -type d`; do cd $DIR; cd $START; done #END IF SCRIPT The code above works fine as long as there are no spaces in $DIR . How can I ensure that bash changes into directories where the path contains spaces? So far I've tried: cd "$DIR" and: DIR=`echo $DIR | sed -e "s/\ /\\\ /g"` cd $DIR Any thoughts? Peter