diff options
author | Ben Boeckel <MathStuf@gmail.com> | 2011-03-10 22:23:36 -0500 |
---|---|---|
committer | Ben Boeckel <MathStuf@gmail.com> | 2011-03-10 22:32:50 -0500 |
commit | dcf3ffda8005c73c15f5142c61ee492f14af590a (patch) | |
tree | b73cb35a08af35c81f0bf3e605a25bf378016f85 /examples/data/scripts/download.sh | |
parent | f43741a91218936749afb3242a6e473f76387684 (diff) |
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.
Diffstat (limited to 'examples/data/scripts/download.sh')
-rwxr-xr-x | examples/data/scripts/download.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/data/scripts/download.sh b/examples/data/scripts/download.sh index 448e086..8b4761f 100755 --- a/examples/data/scripts/download.sh +++ b/examples/data/scripts/download.sh @@ -7,11 +7,12 @@ # if nothing is printed to stdout, the download will be cancelled. . "$UZBL_UTIL_DIR/uzbl-dir.sh" +. "$UZBL_UTIL_DIR/uzbl-util.sh" # the URL that is being downloaded uri="$1" -safe_uri="$( printf "$uri" | sed -e 's/\W/-/g' )" +safe_uri="$( print "$uri" | sed -e 's/\W/-/g' )" # a filename suggested by the server or based on the URL suggested_filename="${2:-$safe_uri}" @@ -24,4 +25,4 @@ content_type="$3" total_size="$4" # just save the file to the default directory with the suggested name -printf "$UZBL_DOWNLOAD_DIR/$suggested_filename\n" +print "$UZBL_DOWNLOAD_DIR/$suggested_filename\n" |