--- a/main/fetch_tarballs.sh
+++ b/main/fetch_tarballs.sh
@@ -187,9 +187,9 @@ download_and_check ()
 
 echo "downloading tar balls to $TARFILE_LOCATION"
 
-while read line ; do
-    # Remove leading and trailing space and comments
-    line=`echo $line | sed 's/^[[:space:]]*//;s/[[:space:]]*$//;s/[[:space:]]*#.*$//'`
+while read line ;do
+    # Remove leading and trailing space and icomments
+    line=`echo $line | sed 's/^\s*//;s/\s*$//;s/\s*#.*$//'`
     case $line in
         # Ignore empty lines.
         '')
