Skip to content

Commit

Permalink
variable quoting for $HOME with spaces. seems like it works.
Browse files Browse the repository at this point in the history
  • Loading branch information
rupa committed Apr 6, 2010
1 parent 15d37f8 commit 91c3b9e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions z.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ z() {
for( i in rank ) print i "|" 0.9*rank[i] "|" time[i] # aging
} else for( i in rank ) print i "|" rank[i] "|" time[i]
}
' $datafile 2>/dev/null > $datafile.tmp
mv -f $datafile.tmp $datafile
' "$datafile" 2>/dev/null > "$datafile.tmp"
mv -f "$datafile.tmp" "$datafile"
elif [ "$1" = "--complete" ]; then
# tab completion
awk -v q="$2" -F"|" '
Expand All @@ -58,7 +58,7 @@ z() {
if( $1 ) print $1
}
}
' $datafile 2>/dev/null
' "$datafile" 2>/dev/null
else
# list/go
while [ "$1" ]; do case "$1" in
Expand Down Expand Up @@ -132,11 +132,11 @@ z() {
output(wcase, cx, common(wcase, a, 0))
} else if( ncx ) output(nocase, ncx, common(nocase, a, 1))
}
' $datafile)"
' "$datafile")"
if [ $? -gt 0 ]; then
rm -f $datafile.tmp
rm -f "$datafile.tmp"
else
mv -f $datafile.tmp $datafile
mv -f "$datafile.tmp" "$datafile"
[ "$cd" ] && cd "$cd"
fi
fi
Expand Down

0 comments on commit 91c3b9e

Please sign in to comment.