diff --git a/dev/mima b/dev/mima
index 7857294f61cafcb6a65731d8111f5dc345789e8a..4c3e65039b1609401c3e7e6b74d5138f832f8212 100755
--- a/dev/mima
+++ b/dev/mima
@@ -22,7 +22,7 @@ set -e
 
 # Go to the Spark project root directory
 FWDIR="$(cd `dirname $0`/..; pwd)"
-cd $FWDIR
+cd "$FWDIR"
 
 echo -e "q\n" | sbt/sbt oldDeps/update
 
diff --git a/dev/run-tests-jenkins b/dev/run-tests-jenkins
index 8dda671e976ce659f28f341bc50764e92c6a1be2..3076eb847b420323de69cf13ada6ddd7b0e6e476 100755
--- a/dev/run-tests-jenkins
+++ b/dev/run-tests-jenkins
@@ -22,7 +22,7 @@
 
 # Go to the Spark project root directory
 FWDIR="$(cd `dirname $0`/..; pwd)"
-cd $FWDIR
+cd "$FWDIR"
 
 COMMENTS_URL="https://api.github.com/repos/apache/spark/issues/$ghprbPullId/comments"
 
diff --git a/make-distribution.sh b/make-distribution.sh
index c08093f46b61f467da4504596238ea1b1cf1bfa5..0a3283ecec6f8af73e6e890bde1a945a6fdff022 100755
--- a/make-distribution.sh
+++ b/make-distribution.sh
@@ -150,7 +150,7 @@ else
 fi
 
 # Build uber fat JAR
-cd $FWDIR
+cd "$FWDIR"
 
 export MAVEN_OPTS="-Xmx2g -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=512m"