diff options
author | Ben Boeckel <MathStuf@gmail.com> | 2011-03-10 21:09:03 -0500 |
---|---|---|
committer | Ben Boeckel <MathStuf@gmail.com> | 2011-03-10 22:32:50 -0500 |
commit | 5f2a6b9371fcf2ca78143cd255242e1cacac6ad1 (patch) | |
tree | 99ed27b7f261673b85c13bf222ed36b02d67cf76 /examples/data/scripts/formfiller.sh | |
parent | 8e1eee5059058a774ba3124ce18d5f0d52415202 (diff) |
Use printf rather than echo
Diffstat (limited to 'examples/data/scripts/formfiller.sh')
-rwxr-xr-x | examples/data/scripts/formfiller.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/data/scripts/formfiller.sh b/examples/data/scripts/formfiller.sh index 4b4fb4e..2895e5b 100755 --- a/examples/data/scripts/formfiller.sh +++ b/examples/data/scripts/formfiller.sh @@ -56,7 +56,7 @@ MODELINE="> vim:ft=formfiller" action="$1" shift -domain="$( echo "$UZBL_URI" | sed -e 's/\(http\|https\):\/\/\([^\/]\+\)\/.*/\2/' )" +domain="$( printf "$UZBL_URI\n" | sed -e 's/\(http\|https\):\/\/\([^\/]\+\)\/.*/\2/' )" form_file="$UZBL_FORMS_DIR/$domain" if [ "$action" != 'edit' ] && [ "$action" != 'new' ] && [ "$action" != 'load' ] && [ "$action" != 'add' ] && [ "$action" != 'once' ]; then @@ -147,7 +147,7 @@ elif [ "$action" = "once" ]; then printf "js %s dump();\n" "$dumpFunction" | \ socat - "unix-connect:$UZBL_SOCKET" | \ sed -n -e '/^[^(]\+([^)]\+):/p' > "$tmpfile" - echo "$MODELINE" >> "$tmpfile" + printf "$MODELINE\n" >> "$tmpfile" $UZBL_EDITOR "$tmpfile" [ -e "$tmpfile" ] || exit 2 @@ -170,7 +170,7 @@ elif [ "$action" = "once" ]; then else if [ "$action" = 'new' -o "$action" = 'add' ]; then [ "$action" = 'new' ] && echo "$MODELINE" > "$form_file" - echo "!profile=NAME_THIS_PROFILE$RAND" >> "$form_file" + printf "!profile=NAME_THIS_PROFILE$RAND\n" >> "$form_file" # # 2. and 3. line (tr -d and sed) are because, on gmail login for example, # <input > tag is splited into lines |