Comment 1 for bug 932388

Revision history for this message
Alon Swartz (alonswartz) wrote :

Thanks for reporting the issue. I committed a fix and it will be included in all new appliances.
You can fix it in current releases with the following diff:

/etc/skel/.bashrc
@@ -30,17 +30,17 @@ fi

 function realpath()
 {
- f=$1
+ f=$@

- if [ -d $f ]; then
+ if [ -d "$f" ]; then
         base=""
- dir=$f
+ dir="$f"
     else
- base="/$(basename $f)"
- dir=$(dirname $f)
+ base="/$(basename "$f")"
+ dir=$(dirname "$f")
     fi

- dir=$(cd $dir && /bin/pwd)
+ dir=$(cd "$dir" && /bin/pwd)

     echo "$dir$base"
 }
@@ -53,10 +53,10 @@ promptpath () {
     # if we are in the home directory
     if echo $realpwd | grep -q "^$realhome"; then
         path=$(echo $realpwd | sed "s|^$realhome|\~|")
- if [ $path = "~" ] || [ $(dirname $path) = "~" ]; then
+ if [ "$path" = "~" ] || [ "$(dirname "$path")" = "~" ]; then
             echo $path
         else
- echo $(basename $(dirname $path))/$(basename $path)
+ echo $(basename $(dirname "$path"))/$(basename "$path")
         fi
         return
     fi
@@ -66,8 +66,8 @@ promptpath () {
     if [ $(dirname $path_dir) = "/" ]; then
         echo $PWD
     else
- path_parent=$(basename $path_dir)
- path_base=$(basename $PWD)
+ path_parent=$(basename "$path_dir")
+ path_base=$(basename "$PWD")

         echo $path_parent/$path_base
     fi