From 32f6f8360684c0b583e613cf5727f0c102438bd2 Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Sun, 13 Mar 2011 21:49:27 -0600 Subject: sh scripts: replace print with echo/printf we can safely use echo in many of the situations where 'print' is being used, and we can use printf directly in other places. --- examples/data/scripts/session.sh | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'examples/data/scripts/session.sh') diff --git a/examples/data/scripts/session.sh b/examples/data/scripts/session.sh index d03554b..4e7bfd1 100755 --- a/examples/data/scripts/session.sh +++ b/examples/data/scripts/session.sh @@ -26,7 +26,6 @@ if [ -z "$UZBL_UTIL_DIR" ]; then fi . "$UZBL_UTIL_DIR/uzbl-dir.sh" -. "$UZBL_UTIL_DIR/uzbl-util.sh" [ -d "$UZBL_DATA_DIR" ] || exit 1 @@ -55,27 +54,27 @@ case $act in "endinstance") if [ -z "$UZBL_FIFO" ]; then - print "session manager: endinstance must be called from uzbl\n" + echo "session manager: endinstance must be called from uzbl" exit 1 fi - [ "$UZBL_URI" != "(null)" ] && print "$UZBL_URI\n" >> "$UZBL_SESSION_FILE" - print "exit\n" > "$UZBL_FIFO" + [ "$UZBL_URI" != "(null)" ] && echo "$UZBL_URI" >> "$UZBL_SESSION_FILE" + echo "exit" > "$UZBL_FIFO" ;; "endsession") for fifo in "$UZBL_FIFO_DIR/uzbl_fifo_*"; do if [ "$fifo" != "$UZBL_FIFO" ]; then - print "spawn $scriptfile endinstance\n" > "$fifo" + echo "spawn $scriptfile endinstance" > "$fifo" fi done - [ -z "$UZBL_FIFO" ] || print "spawn $scriptfile endinstance\n" > "$UZBL_FIFO" + [ -z "$UZBL_FIFO" ] || echo "spawn $scriptfile endinstance" > "$UZBL_FIFO" ;; *) - print "session manager: bad action\n" - print "Usage: $scriptfile [COMMAND] where commands are:\n" - print " launch - Restore a saved session or start a new one\n" - print " endinstance - Quit the current instance. Must be called from uzbl\n" - print " endsession - Quit the running session.\n" + echo "session manager: bad action" + echo "Usage: $scriptfile [COMMAND] where commands are:" + echo " launch - Restore a saved session or start a new one" + echo " endinstance - Quit the current instance. Must be called from uzbl" + echo " endsession - Quit the running session." ;; esac -- cgit v1.2.3