aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xexamples/data/scripts/download.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/data/scripts/download.sh b/examples/data/scripts/download.sh
index 561ac31..6bcd9d1 100755
--- a/examples/data/scripts/download.sh
+++ b/examples/data/scripts/download.sh
@@ -11,8 +11,10 @@
# the URL that is being downloaded
uri="$1"
+safe_uri="$(echo "$uri" | sed -e 's/\W/-/g')"
+
# a filename suggested by the server or based on the URL
-suggested_filename="${2:-$(echo "$uri" | sed -e 's/\W/-/g')}"
+suggested_filename="${2:-$safe_uri}"
# the mimetype of the file being downloaded
content_type="$3"