diff --git a/setup-download-links.sh b/setup-download-links.sh
index 065d6f5628d1bcf42410cba33f692ddd233339d7..a73042c794b0031e7c7e1b40e271b7388e0dcc06 100755
--- a/setup-download-links.sh
+++ b/setup-download-links.sh
@@ -4,8 +4,7 @@ set -e
 
 cd _includes
 
-for branch in release snapshot
-do
+for branch in release snapshot; do
     mkdir -p "$branch"
     cd "$branch"
 
@@ -14,32 +13,28 @@ do
     wget --no-verbose "https://www.dynare.org/$branch/windows.json"
     wget --no-verbose "https://www.dynare.org/$branch/windows-zip.json"
 
-    arr=("macosx" "source" "windows" "windows-zip")
-
-    for dir in "${arr[@]}"
-    do
+    for dir in macosx source windows windows-zip; do
         readarray -t filenames < <(jq .[].filename "$dir.json")
         readarray -t timestamps < <(jq .[].date "$dir.json")
         readarray -t size < <(jq .[].size "$dir.json")
         n=$(jq length "$dir.json")
         includeFilename="download-$branch-$dir.html"
-        echo "" > "$includeFilename"
-        for ((i = 0; i < n; i++))
-        do
-            filename="${filenames[i]%\"}"
-            filename="${filename#\"}"
+        echo > "$includeFilename"
+        for ((i = 0; i < n; i++)); do
+            filename=${filenames[i]%\"}
+            filename=${filename#\"}
             mb=$((size[i] / (10 ** 6)))
-            if [ "$branch" = "release" ]; then
+            if [[ $branch == release ]]; then
                 IFS='-' read -ra split <<< "$filename"
-                if [ "$dir" = "windows" ] || [ "$dir" = "windows-zip" ]; then
-                    version="${split[1]}"
+                if [[ $dir == windows* ]]; then
+                    version=${split[1]}
                     ext=${filename##*.}
-                elif [ "$dir" = "macosx" ]; then
+                elif [[ $dir == macosx ]]; then
                     version=${split[1]%.*}
                     ext=${filename##*.}
                 else
-                    ext="$(echo "${split[1]}" | rev | cut -d. -f2,1 | rev)"
-                    version="$(echo "${split[1]}" | cut -d. -f1,2,3)"
+                    ext=$(echo "${split[1]}" | rev | cut -d. -f2,1 | rev)
+                    version=$(echo "${split[1]}" | cut -d. -f1,2,3)
                     echo "{% assign dynare_stable_version = \"$version\" %}" > ../dynare_stable_version.md
                 fi
                 {
@@ -47,12 +42,12 @@ do
                     echo "<a href=\"https://www.dynare.org/$branch/$dir/$filename.sig\">[signature]</a>"
                 } >> "$includeFilename"
             else
-                timestamp="${timestamps[i]%\"}"
-                timestamp="${timestamp#\"}"
-                if [[ "$OSTYPE" == "darwin"* ]]; then
-                    datestr="$(date -r "$timestamp")"
+                timestamp=${timestamps[i]%\"}
+                timestamp=${timestamp#\"}
+                if [[ $OSTYPE == darwin* ]]; then
+                    datestr=$(date -r "$timestamp")
                 else
-                    datestr="$(date -d @"$timestamp")"
+                    datestr=$(date -d @"$timestamp")
                 fi
                 {
                     echo "<div class=\"download_row\" onclick=\"document.location = 'https://www.dynare.org/$branch/$dir/$filename'\" onkeypress=\"document.location = 'https://www.dynare.org/$branch/$dir/$filename'\">"