From dcf3ffda8005c73c15f5142c61ee492f14af590a Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 10 Mar 2011 22:23:36 -0500 Subject: Use print rather than printf printf chokes on $(printf "%DD") which may very well come up in an encoded URL. Avoid that with the print alias. --- examples/data/scripts/follow.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'examples/data/scripts/follow.sh') diff --git a/examples/data/scripts/follow.sh b/examples/data/scripts/follow.sh index b038c12..ac5c6cb 100755 --- a/examples/data/scripts/follow.sh +++ b/examples/data/scripts/follow.sh @@ -3,24 +3,26 @@ # This script is just a wrapper around follow.js that lets us change uzbl's mode # after a link is selected. +. "$UZBL_UTIL_DIR/uzbl-util.sh" + keys="$1" shift # 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 - printf "script @scripts_dir/follow.js \"@{follow_hint_keys} $keys\"\n" > "$UZBL_FIFO" + print "script @scripts_dir/follow.js \"@{follow_hint_keys} $keys\"\n" > "$UZBL_FIFO" exit fi -result="$( printf "script @scripts_dir/follow.js \"@{follow_hint_keys} $keys\"\n" | socat - "unix-connect:$UZBL_SOCKET" )" +result="$( print "script @scripts_dir/follow.js \"@{follow_hint_keys} $keys\"\n" | socat - "unix-connect:$UZBL_SOCKET" )" case $result in *XXXEMIT_FORM_ACTIVEXXX*) # a form element was selected - printf "event FORM_ACTIVE\n" > "$UZBL_FIFO" + print "event FORM_ACTIVE\n" > "$UZBL_FIFO" ;; *XXXRESET_MODEXXX*) # a link was selected, reset uzbl's input mode - printf "set mode=\n" > "$UZBL_FIFO" + print "set mode=\n" > "$UZBL_FIFO" ;; esac -- cgit v1.2.3