From 6cb7be2b071f5e540c33ecc5e21ab22c81434834 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 10 Mar 2011 20:02:12 -0500 Subject: Reduce the complexity of the variable assignment --- examples/data/scripts/download.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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" -- cgit v1.2.3