aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Ben Boeckel <MathStuf@gmail.com>2011-03-10 19:54:44 -0500
committerGravatar Ben Boeckel <MathStuf@gmail.com>2011-03-10 21:10:41 -0500
commit06c29bbd5d1ad0542d8de4a6661bd8366d9c56d5 (patch)
tree33ed8ecbff72b73a99711f24e6fa6e785d7587cd
parentbfbd8eaf428b8cf04c88cc7acdcf9230c82120b4 (diff)
Quote variables which may contain spaces
-rwxr-xr-xexamples/data/scripts/download.sh10
-rwxr-xr-xexamples/data/scripts/follow.sh4
-rwxr-xr-xexamples/data/scripts/formfiller.sh70
-rwxr-xr-xexamples/data/scripts/go_input.sh2
-rwxr-xr-xexamples/data/scripts/history.sh2
-rwxr-xr-xexamples/data/scripts/insert_bookmark.sh6
-rwxr-xr-xexamples/data/scripts/instance-select-wmii.sh14
-rwxr-xr-xexamples/data/scripts/load_cookies.sh8
-rwxr-xr-xexamples/data/scripts/load_url_from_bookmarks.sh6
-rwxr-xr-xexamples/data/scripts/load_url_from_history.sh8
-rwxr-xr-xexamples/data/scripts/session.sh14
-rw-r--r--examples/data/scripts/util/uzbl-dir.sh18
-rw-r--r--examples/data/scripts/util/uzbl-window.sh16
13 files changed, 89 insertions, 89 deletions
diff --git a/examples/data/scripts/download.sh b/examples/data/scripts/download.sh
index a382d9f..561ac31 100755
--- a/examples/data/scripts/download.sh
+++ b/examples/data/scripts/download.sh
@@ -9,17 +9,17 @@
. "$UZBL_UTIL_DIR/uzbl-dir.sh"
# the URL that is being downloaded
-uri=$1
+uri="$1"
# a filename suggested by the server or based on the URL
-suggested_filename=${2:-$(echo "$uri" | sed -e 's/\W/-/g')}
+suggested_filename="${2:-$(echo "$uri" | sed -e 's/\W/-/g')}"
# the mimetype of the file being downloaded
-content_type=$3
+content_type="$3"
# the size of the downloaded file in bytes. this is not always accurate, since
# the server might not have sent a size with its response headers.
-total_size=$4
+total_size="$4"
# just save the file to the default directory with the suggested name
-echo $UZBL_DOWNLOAD_DIR/$suggested_filename
+echo "$UZBL_DOWNLOAD_DIR/$suggested_filename"
diff --git a/examples/data/scripts/follow.sh b/examples/data/scripts/follow.sh
index d1560bf..3d0e992 100755
--- a/examples/data/scripts/follow.sh
+++ b/examples/data/scripts/follow.sh
@@ -6,11 +6,11 @@
# if socat is installed then we can change Uzbl's input mode once a link is
# selected; otherwise we just select a link.
if ! which socat >/dev/null 2>&1; then
- echo 'script @scripts_dir/follow.js "@{follow_hint_keys} '$1'"' > "$UZBL_FIFO"
+ echo "script @scripts_dir/follow.js \"@{follow_hint_keys} $1\"" > "$UZBL_FIFO"
exit
fi
-result=$(echo 'script @scripts_dir/follow.js "@{follow_hint_keys} '$1'"' | socat - unix-connect:"$UZBL_SOCKET")
+result="$(echo "script @scripts_dir/follow.js \"@{follow_hint_keys} $1\"" | socat - "unix-connect:$UZBL_SOCKET")"
case $result in
*XXXEMIT_FORM_ACTIVEXXX*)
# a form element was selected
diff --git a/examples/data/scripts/formfiller.sh b/examples/data/scripts/formfiller.sh
index 408666f..9ce36b4 100755
--- a/examples/data/scripts/formfiller.sh
+++ b/examples/data/scripts/formfiller.sh
@@ -47,15 +47,15 @@ DMENU_OPTIONS="vertical resize"
. "$UZBL_UTIL_DIR/editor.sh"
. "$UZBL_UTIL_DIR/uzbl-dir.sh"
-RAND=$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -c 1-5)
+RAND="$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -c 1-5)"
MODELINE="> vim:ft=formfiller"
-[ -d "$(dirname $UZBL_FORMS_DIR)" ] || exit 1
-[ -d $UZBL_FORMS_DIR ] || mkdir $UZBL_FORMS_DIR || exit 1
+[ -d "$(dirname "$UZBL_FORMS_DIR")" ] || exit 1
+[ -d "$UZBL_FORMS_DIR" ] || mkdir "$UZBL_FORMS_DIR" || exit 1
-action=$1
+action="$1"
-domain=$(echo $UZBL_URI | sed -e 's/\(http\|https\):\/\/\([^\/]\+\)\/.*/\2/')
+domain="$(echo "$UZBL_URI" | sed -e 's/\(http\|https\):\/\/\([^\/]\+\)\/.*/\2/')"
if [ "$action" != 'edit' -a "$action" != 'new' -a "$action" != 'load' -a "$action" != 'add' -a "$action" != 'once' ]; then
action="new"
@@ -92,7 +92,7 @@ dumpFunction="function dump() { \
catch(err) { } \
} \
return rv; \
-}; "
+};"
insertFunction="function insert(fname, ftype, fvalue, fchecked) { \
var allFrames = new Array(window); \
@@ -118,63 +118,63 @@ insertFunction="function insert(fname, ftype, fvalue, fchecked) { \
} \
catch(err) { } \
} \
-}; "
+};"
if [ "$action" = 'load' ]; then
- [ -e $UZBL_FORMS_DIR/$domain ] || exit 2
- if [ $(cat $UZBL_FORMS_DIR/$domain | grep "!profile" | wc -l) -gt 1 ]; then
- menu=$(cat $UZBL_FORMS_DIR/$domain | \
- sed -n -e 's/^!profile=\([^[:blank:]]\+\)/\1/p')
- option=$(printf "$menu" | $DMENU)
+ [ -e "$UZBL_FORMS_DIR/$domain" ] || exit 2
+ if [ "$(cat "$UZBL_FORMS_DIR/$domain" | grep "!profile" | wc -l)" -gt 1 ]; then
+ menu="$(cat "$UZBL_FORMS_DIR/$domain" | \
+ sed -n -e 's/^!profile=\([^[:blank:]]\+\)/\1/p')"
+ option="$(printf "$menu" | $DMENU)"
fi
# Remove comments
- sed -i -e '/^>/d' $tmpfile
+ sed -i -e '/^>/d' "$tmpfile"
- sed -i -e 's/^\([^{]\+\){\([^}]*\)}(\(radio\|checkbox\)):\(off\|no\|false\|unchecked\|0\|$\)/\1{\2}(\3):0/I;s/^\([^{]\+\){\([^}]*\)}(\(radio\|checkbox\)):[^0]\+/\1{\2}(\3):1/I' $UZBL_FORMS_DIR/$domain
- fields=$(cat $UZBL_FORMS_DIR/$domain | \
+ sed -i -e 's/^\([^{]\+\){\([^}]*\)}(\(radio\|checkbox\)):\(off\|no\|false\|unchecked\|0\|$\)/\1{\2}(\3):0/I;s/^\([^{]\+\){\([^}]*\)}(\(radio\|checkbox\)):[^0]\+/\1{\2}(\3):1/I' "$UZBL_FORMS_DIR/$domain"
+ fields="$(cat "$UZBL_FORMS_DIR/$domain" | \
sed -n -e "/^!profile=${option}/,/^!profile=/p" | \
sed -e '/^!profile=/d' | \
sed -e 's/^\([^(]\+(\)\(radio\|checkbox\|text\|search\|textarea\|password\)):/%{>\1\2):<}%/' | \
sed -e 's/^\(.\+\)$/<{br}>\1/' | \
tr -d '\n' | \
- sed -e 's/<{br}>%{>\([^(]\+(\)\(radio\|checkbox\|text\|search\|textarea\|password\)):<}%/\\n\1\2):/g')
+ sed -e 's/<{br}>%{>\([^(]\+(\)\(radio\|checkbox\|text\|search\|textarea\|password\)):<}%/\\n\1\2):/g')"
printf '%s\n' "${fields}" | \
sed -n -e "s/\([^(]\+\)(\(password\|text\|search\|textarea\)\+):[ ]*\(.\+\)/js $insertFunction; insert('\1', '\2', '\3', 0);/p" | \
- sed -e 's/@/\\@/g;s/<{br}>/\\\\n/g' | socat - unix-connect:$UZBL_SOCKET
+ sed -e 's/@/\\@/g;s/<{br}>/\\\\n/g' | socat - "unix-connect:$UZBL_SOCKET"
printf '%s\n' "${fields}" | \
sed -n -e "s/\([^{]\+\){\([^}]*\)}(\(radio\|checkbox\)):[ ]*\(.\+\)/js $insertFunction; insert('\1', '\3', '\2', \4);/p" | \
- sed -e 's/@/\\@/g' | socat - unix-connect:$UZBL_SOCKET
+ sed -e 's/@/\\@/g' | socat - "unix-connect:$UZBL_SOCKET"
elif [ "$action" = "once" ]; then
- tmpfile=$(mktemp)
+ tmpfile="$(mktemp)"
printf 'js %s dump(); \n' "$dumpFunction" | \
- socat - unix-connect:$UZBL_SOCKET | \
- sed -n -e '/^[^(]\+([^)]\+):/p' > $tmpfile
- echo "$MODELINE" >> $tmpfile
- $UZBL_EDITOR $tmpfile
+ socat - "unix-connect:$UZBL_SOCKET" | \
+ sed -n -e '/^[^(]\+([^)]\+):/p' > "$tmpfile"
+ echo "$MODELINE" >> "$tmpfile"
+ $UZBL_EDITOR "$tmpfile"
- [ -e $tmpfile ] || exit 2
+ [ -e "$tmpfile" ] || exit 2
# Remove comments
- sed -i -e '/^>/d' $tmpfile
+ sed -i -e '/^>/d' "$tmpfile"
- sed -i -e 's/^\([^{]\+\){\([^}]*\)}(\(radio\|checkbox\)):\(off\|no\|false\|unchecked\|0\|$\)/\1{\2}(\3):0/I;s/^\([^{]\+\){\([^}]*\)}(\(radio\|checkbox\)):[^0]\+/\1{\2}(\3):1/I' $tmpfile
- fields=$(cat $tmpfile | \
+ sed -i -e 's/^\([^{]\+\){\([^}]*\)}(\(radio\|checkbox\)):\(off\|no\|false\|unchecked\|0\|$\)/\1{\2}(\3):0/I;s/^\([^{]\+\){\([^}]*\)}(\(radio\|checkbox\)):[^0]\+/\1{\2}(\3):1/I' "$tmpfile"
+ fields="$(cat "$tmpfile" | \
sed -e 's/^\([^(]\+(\)\(radio\|checkbox\|text\|search\|textarea\|password\)):/%{>\1\2):<}%/' | \
sed -e 's/^\(.\+\)$/<{br}>\1/' | \
tr -d '\n' | \
- sed -e 's/<{br}>%{>\([^(]\+(\)\(radio\|checkbox\|text\|search\|textarea\|password\)):<}%/\\n\1\2):/g')
+ sed -e 's/<{br}>%{>\([^(]\+(\)\(radio\|checkbox\|text\|search\|textarea\|password\)):<}%/\\n\1\2):/g')"
printf '%s\n' "${fields}" | \
sed -n -e "s/\([^(]\+\)(\(password\|text\|search\|textarea\)\+):[ ]*\(.\+\)/js $insertFunction; insert('\1', '\2', '\3', 0);/p" | \
- sed -e 's/@/\\@/g;s/<{br}>/\\\\n/g' | socat - unix-connect:$UZBL_SOCKET
+ sed -e 's/@/\\@/g;s/<{br}>/\\\\n/g' | socat - "unix-connect:$UZBL_SOCKET"
printf '%s\n' "${fields}" | \
sed -n -e "s/\([^{]\+\){\([^}]*\)}(\(radio\|checkbox\)):[ ]*\(.\+\)/js $insertFunction; insert('\1', '\3', '\2', \4);/p" | \
- sed -e 's/@/\\@/g' | socat - unix-connect:$UZBL_SOCKET
- rm -f $tmpfile
+ sed -e 's/@/\\@/g' | socat - "unix-connect:$UZBL_SOCKET"
+ rm -f "$tmpfile"
else
if [ "$action" = 'new' -o "$action" = 'add' ]; then
- [ "$action" = 'new' ] && echo "$MODELINE" > $UZBL_FORMS_DIR/$domain
- echo "!profile=NAME_THIS_PROFILE$RAND" >> $UZBL_FORMS_DIR/$domain
+ [ "$action" = 'new' ] && echo "$MODELINE" > "$UZBL_FORMS_DIR/$domain"
+ echo "!profile=NAME_THIS_PROFILE$RAND" >> "$UZBL_FORMS_DIR/$domain"
#
# 2. and 3. line (tr -d and sed) are because, on gmail login for example,
# <input > tag is splited into lines
@@ -192,8 +192,8 @@ else
# passwd(password):
#
printf 'js %s dump(); \n' "$dumpFunction" | \
- socat - unix-connect:$UZBL_SOCKET | \
- sed -n -e '/^[^(]\+([^)]\+):/p' >> $UZBL_FORMS_DIR/$domain
+ socat - "unix-connect:$UZBL_SOCKET" | \
+ sed -n -e '/^[^(]\+([^)]\+):/p' >> "$UZBL_FORMS_DIR/$domain"
fi
[ -e "$UZBL_FORMS_DIR/$domain" ] || exit 3 #this should never happen, but you never know.
$UZBL_EDITOR "$UZBL_FORMS_DIR/$domain" #TODO: if user aborts save in editor, the file is already overwritten
diff --git a/examples/data/scripts/go_input.sh b/examples/data/scripts/go_input.sh
index ace0e79..a09c604 100755
--- a/examples/data/scripts/go_input.sh
+++ b/examples/data/scripts/go_input.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-case $(echo 'script @scripts_dir/go_input.js' | socat - unix-connect:"$UZBL_SOCKET") in
+case "$(echo 'script @scripts_dir/go_input.js' | socat - "unix-connect:$UZBL_SOCKET")" in
*XXXEMIT_FORM_ACTIVEXXX*) echo 'event FORM_ACTIVE' > "$UZBL_FIFO" ;;
esac
diff --git a/examples/data/scripts/history.sh b/examples/data/scripts/history.sh
index 3972e3a..bbef20a 100755
--- a/examples/data/scripts/history.sh
+++ b/examples/data/scripts/history.sh
@@ -4,4 +4,4 @@
[ -w "$UZBL_HISTORY_FILE" ] || [ ! -a "$UZBL_HISTORY_FILE" ] || exit 1
-echo $(date +'%Y-%m-%d %H:%M:%S')" $UZBL_URI $UZBL_TITLE" >> $UZBL_HISTORY_FILE
+echo "$( date +'%Y-%m-%d %H:%M:%S' ) $UZBL_URI $UZBL_TITLE" >> "$UZBL_HISTORY_FILE"
diff --git a/examples/data/scripts/insert_bookmark.sh b/examples/data/scripts/insert_bookmark.sh
index a42948c..374bea0 100755
--- a/examples/data/scripts/insert_bookmark.sh
+++ b/examples/data/scripts/insert_bookmark.sh
@@ -7,9 +7,9 @@
which zenity >/dev/null 2>&1 || exit 2
-tags=$(zenity --entry --text="Enter space-separated tags for bookmark $UZBL_URI:")
-exitstatus=$?
-[ $exitstatus -eq 0 ] || exit $exitstatus
+tags="$(zenity --entry --text="Enter space-separated tags for bookmark $UZBL_URI:")"
+exitstatus="$?"
+[ "$exitstatus" -eq 0 ] || exit "$exitstatus"
# TODO: check if already exists, if so, and tags are different: ask if you want to replace tags
echo "$UZBL_URI $tags" >> "$UZBL_BOOKMARKS_FILE"
diff --git a/examples/data/scripts/instance-select-wmii.sh b/examples/data/scripts/instance-select-wmii.sh
index b3a5a87..57ef0cb 100755
--- a/examples/data/scripts/instance-select-wmii.sh
+++ b/examples/data/scripts/instance-select-wmii.sh
@@ -16,26 +16,26 @@ DMENU_SCHEME="wmii"
case "$1" in
"list" )
- list=
+ list=""
# get window id's of uzbl clients. we could also get the label in one shot but it's pretty tricky
for i in $(wmiir read /tag/sel/index | grep uzbl |cut -d ' ' -f2); do
- label=$(wmiir read /client/$i/label)
+ label="$(wmiir read /client/$i/label)"
list="$list$i : $label\n"
done
- window=$(printf "$list\n" | $DMENU | cut -d ' ' -f1)
+ window="$(printf "$list\n" | $DMENU | cut -d ' ' -f1)"
wmiir xwrite /tag/sel/ctl "select client $window"
;;
"next" )
- current=$(wmiir read /client/sel/ctl | head -n 1)
+ current="$(wmiir read /client/sel/ctl | head -n 1)"
# find the next uzbl window and focus it
- next=$(wmiir read /tag/sel/index | grep -A 10000 " $current " | grep -m 1 uzbl | cut -d ' ' -f2)
+ next="$(wmiir read /tag/sel/index | grep -A 10000 " $current " | grep -m 1 uzbl | cut -d ' ' -f2)"
if [ -n "$next" ]; then
wmiir xwrite /tag/sel/ctl "select client $next"
fi
;;
"prev" )
- current=$(wmiir read /client/sel/ctl | head -n 1)
- prev=$(wmiir read /tag/sel/index | grep -B 10000 " $current " | tac | grep -m 1 uzbl | cut -d ' ' -f2)
+ current="$(wmiir read /client/sel/ctl | head -n 1)"
+ prev="$(wmiir read /tag/sel/index | grep -B 10000 " $current " | tac | grep -m 1 uzbl | cut -d ' ' -f2)"
if [ -n "$prev" ]; then
wmiir xwrite /tag/sel/ctl "select client $prev"
fi
diff --git a/examples/data/scripts/load_cookies.sh b/examples/data/scripts/load_cookies.sh
index 17ec2ad..65541b4 100755
--- a/examples/data/scripts/load_cookies.sh
+++ b/examples/data/scripts/load_cookies.sh
@@ -1,9 +1,9 @@
#!/bin/sh
-if [ "$1" != "" ]; then
- cookie_file=$1
+if [ -n "$1" ]; then
+ cookie_file="$1"
else
- cookie_file=${XDG_DATA_HOME:-$HOME/.local/share}/uzbl/cookies.txt
+ cookie_file="${XDG_DATA_HOME:-$HOME/.local/share}/uzbl/cookies.txt"
fi
awk -F \\t '
@@ -17,4 +17,4 @@ printf("add_cookie \"%s\" \"%s\" \"%s\" \"%s\" \"%s\" \"%s\"\n", substr($1,lengt
$0 !~ /^#/ {
printf("add_cookie \"%s\" \"%s\" \"%s\" \"%s\" \"%s\" \"%s\"\n", $1, $3, $6, $7, scheme[$4], $5)
}
-' $cookie_file
+' "$cookie_file"
diff --git a/examples/data/scripts/load_url_from_bookmarks.sh b/examples/data/scripts/load_url_from_bookmarks.sh
index 704e106..d47d189 100755
--- a/examples/data/scripts/load_url_from_bookmarks.sh
+++ b/examples/data/scripts/load_url_from_bookmarks.sh
@@ -12,11 +12,11 @@ DMENU_OPTIONS="xmms vertical resize"
if [ -z "$DMENU_HAS_VERTICAL" ]; then
# because they are all after each other, just show the url, not their tags.
- goto=$(awk '{print $1}' "$UZBL_BOOKMARKS_FILE" | $DMENU)
+ goto="$(awk '{print $1}' "$UZBL_BOOKMARKS_FILE" | $DMENU)"
else
# show tags as well
- goto=$($DMENU < "$UZBL_BOOKMARKS_FILE" | awk '{print $1}')
+ goto="$($DMENU < "$UZBL_BOOKMARKS_FILE" | awk '{print $1}')"
fi
[ -n "$goto" ] && echo "uri $goto" > "$UZBL_FIFO"
-#[ -n "$goto" ] && echo "uri $goto" | socat - unix-connect:"$UZBL_SOCKET"
+#[ -n "$goto" ] && echo "uri $goto" | socat - "unix-connect:$UZBL_SOCKET"
diff --git a/examples/data/scripts/load_url_from_history.sh b/examples/data/scripts/load_url_from_history.sh
index 256a342..9cca356 100755
--- a/examples/data/scripts/load_url_from_history.sh
+++ b/examples/data/scripts/load_url_from_history.sh
@@ -11,13 +11,13 @@ DMENU_OPTIONS="xmms vertical resize"
# choose from all entries, sorted and uniqued
# goto=$(awk '{print $3}' $history_file | sort -u | dmenu -i)
if [ -z "$DMENU_HAS_VERTICAL" ]; then
- current=$(tail -n 1 "$UZBL_HISTORY_FILE" | awk '{print $3}');
- goto=$( (echo $current; awk '{print $3}' "$UZBL_HISTORY_FILE" | grep -v "^$current\$" | sort -u) | $DMENU)
+ current="$(tail -n 1 "$UZBL_HISTORY_FILE" | awk '{print $3}')"
+ goto="$( (echo "$current"; awk '{print $3}' "$UZBL_HISTORY_FILE" | grep -v "^$current\$" | sort -u) | $DMENU)"
else
# choose an item in reverse order, showing also the date and page titles
# pick the last field from the first 3 fields. this way you can pick a url (prefixed with date & time) or type just a new url.
- goto=$(tac "$UZBL_HISTORY_FILE" | $DMENU | cut -d ' ' -f -3 | awk '{print $NF}')
+ goto="$(tac "$UZBL_HISTORY_FILE" | $DMENU | cut -d ' ' -f -3 | awk '{print $NF}')"
fi
[ -n "$goto" ] && echo "uri $goto" > "$UZBL_FIFO"
-#[ -n "$goto" ] && echo "uri $goto" | socat - unix-connect:"$UZBL_SOCKET"
+#[ -n "$goto" ] && echo "uri $goto" | socat - "unix-connect:$UZBL_SOCKET"
diff --git a/examples/data/scripts/session.sh b/examples/data/scripts/session.sh
index 4466ef7..80c9744 100755
--- a/examples/data/scripts/session.sh
+++ b/examples/data/scripts/session.sh
@@ -18,19 +18,19 @@
if [ -z "$UZBL_UTIL_DIR" ]; then
# we're being run standalone, we have to figure out where $UZBL_UTIL_DIR is
# using the same logic as uzbl-browser does.
- UZBL_UTIL_DIR=${XDG_DATA_HOME:-$HOME/.local/share}/uzbl/scripts/util
+ UZBL_UTIL_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/uzbl/scripts/util"
if ! [ -d "$UZBL_UTIL_DIR" ]; then
- PREFIX=$(grep '^PREFIX' "$(which uzbl-browser)" | sed -e 's/.*=//')
- UZBL_UTIL_DIR=$PREFIX/share/uzbl/examples/data/scripts/util
+ PREFIX="$(grep '^PREFIX' "$(which uzbl-browser)" | sed -e 's/.*=//')"
+ UZBL_UTIL_DIR="$PREFIX/share/uzbl/examples/data/scripts/util"
fi
fi
. "$UZBL_UTIL_DIR/uzbl-dir.sh"
[ -d "$UZBL_DATA_DIR" ] || exit 1
-UZBL="uzbl-browser -c $UZBL_CONFIG_FILE" # add custom flags and whatever here.
+UZBL="uzbl-browser -c \"$UZBL_CONFIG_FILE\"" # add custom flags and whatever here.
-scriptfile=$(readlink -f $0) # this script
+scriptfile="$(readlink -f "$0")" # this script
act="$1"
if [ -z "$act" ]; then
@@ -39,7 +39,7 @@ fi
case $act in
"launch" )
- urls=$(cat "$UZBL_SESSION_FILE")
+ urls="$(cat "$UZBL_SESSION_FILE")"
if [ -z "$urls" ]; then
$UZBL
else
@@ -60,7 +60,7 @@ case $act in
;;
"endsession" )
- for fifo in "$UZBL_FIFO_DIR"/uzbl_fifo_*; do
+ for fifo in "$UZBL_FIFO_DIR/uzbl_fifo_*"; do
if [ "$fifo" != "$UZBL_FIFO" ]; then
echo "spawn $scriptfile endinstance" > "$fifo"
fi
diff --git a/examples/data/scripts/util/uzbl-dir.sh b/examples/data/scripts/util/uzbl-dir.sh
index bb56954..3d28151 100644
--- a/examples/data/scripts/util/uzbl-dir.sh
+++ b/examples/data/scripts/util/uzbl-dir.sh
@@ -2,18 +2,18 @@
# Common directories and files used in scripts
# Common things first
-UZBL_DATA_DIR=${XDG_DATA_HOME:-$HOME/.local/share}/uzbl
-UZBL_CONFIG_DIR=${XDG_CONFIG_DIR:-$HOME/.config}/uzbl
+UZBL_DATA_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/uzbl"
+UZBL_CONFIG_DIR="${XDG_CONFIG_DIR:-$HOME/.config}/uzbl"
UZBL_FIFO_DIR=/tmp
UZBL_SOCKET_DIR=/tmp
# Directories
-UZBL_DOWNLOAD_DIR=${XDG_DOWNLOAD_DIR:-$HOME}
-UZBL_FORMS_DIR=$UZBL_DATA_DIR/dforms
+UZBL_DOWNLOAD_DIR="${XDG_DOWNLOAD_DIR:-$HOME}"
+UZBL_FORMS_DIR="$UZBL_DATA_DIR/dforms"
# Data files
-UZBL_CONFIG_FILE=$UZBL_CONFIG_DIR/config
-UZBL_COOKIE_FILE=$UZBL_DATA_DIR/cookies.txt
-UZBL_BOOKMARKS_FILE=$UZBL_DATA_DIR/bookmarks
-UZBL_HISTORY_FILE=$UZBL_DATA_DIR/history
-UZBL_SESSION_FILE=$UZBL_DATA_DIR/browser-session
+UZBL_CONFIG_FILE="$UZBL_CONFIG_DIR/config"
+UZBL_COOKIE_FILE="$UZBL_DATA_DIR/cookies.txt"
+UZBL_BOOKMARKS_FILE="$UZBL_DATA_DIR/bookmarks"
+UZBL_HISTORY_FILE="$UZBL_DATA_DIR/history"
+UZBL_SESSION_FILE="$UZBL_DATA_DIR/browser-session"
diff --git a/examples/data/scripts/util/uzbl-window.sh b/examples/data/scripts/util/uzbl-window.sh
index a7e92eb..35ce013 100644
--- a/examples/data/scripts/util/uzbl-window.sh
+++ b/examples/data/scripts/util/uzbl-window.sh
@@ -1,11 +1,11 @@
#!/bin/sh
# uzbl window detection
-UZBL_WIN_POS=$(xwininfo -id $UZBL_XID | \
- sed -ne 's/Corners:[ ]*[+-]\([0-9]*\)[+-]\([0-9]*\).*$/\1 \2/p')
-UZBL_WIN_SIZE=$(xwininfo -id $UZBL_XID | \
- sed -ne 's/-geometry[ ]*\([0-9]*\)x\([0-9]*\).*$/\1 \2/p')
-UZBL_WIN_POS_X=$(echo $UZBL_WIN_POS | cut -d\ -f1)
-UZBL_WIN_POS_Y=$(echo $UZBL_WIN_POS | cut -d\ -f2)
-UZBL_WIN_WIDTH=$(echo $UZBL_WIN_SIZE | cut -d\ -f1)
-UZBL_WIN_HEIGHT=$(echo $UZBL_WIN_SIZE | cut -d\ -f2)
+UZBL_WIN_POS="$(xwininfo -id $UZBL_XID | \
+ sed -ne 's/Corners:[ ]*[+-]\([0-9]*\)[+-]\([0-9]*\).*$/\1 \2/p')"
+UZBL_WIN_SIZE="$(xwininfo -id $UZBL_XID | \
+ sed -ne 's/-geometry[ ]*\([0-9]*\)x\([0-9]*\).*$/\1 \2/p')"
+UZBL_WIN_POS_X="$(echo "$UZBL_WIN_POS" | cut -d\ -f1)"
+UZBL_WIN_POS_Y="$(echo "$UZBL_WIN_POS" | cut -d\ -f2)"
+UZBL_WIN_WIDTH="$(echo "$UZBL_WIN_SIZE" | cut -d\ -f1)"
+UZBL_WIN_HEIGHT="$(echo "$UZBL_WIN_SIZE" | cut -d\ -f2)"