diff --git a/scripts/patch.sh b/scripts/patch.sh
index 2b0aa29e068dc27995978ba09c8355b0c1bcab04..7dfb3061394b44f38555bb46bdb34c3a6cdf64a9 100755
--- a/scripts/patch.sh
+++ b/scripts/patch.sh
@@ -15,14 +15,14 @@ trap 'rm -rf "$PATCHDIR"' EXIT
 for module in $GLUON_MODULES; do
 	echo "--- Patching module '$module' ---"
 
-	git clone -s -b base --single-branch "$GLUONDIR"/$module "$PATCHDIR" 2>/dev/null
+	git clone -s -b base --single-branch "$GLUONDIR/$module" "$PATCHDIR" 2>/dev/null
 
 	cd "$PATCHDIR"
-	for patch in "$GLUONDIR"/patches/$module/*.patch; do
+	for patch in "$GLUONDIR/patches/$module"/*.patch; do
 		git -c user.name='Gluon Patch Manager' -c user.email='gluon@void.example.com' -c commit.gpgsign=false am --whitespace=nowarn --committer-date-is-author-date "$patch"
 	done
 
-	cd "$GLUONDIR"/$module
+	cd "$GLUONDIR/$module"
 	git fetch "$PATCHDIR" 2>/dev/null
 	git checkout -B patched FETCH_HEAD
 	git submodule update --init --recursive
diff --git a/scripts/sha512sum.sh b/scripts/sha512sum.sh
index 921e5c6c65c69bc68ddb9a0ff3b5b22e18b99619..de08b0b8b6d4c6c9820912dd639f3c60b0eb393b 100755
--- a/scripts/sha512sum.sh
+++ b/scripts/sha512sum.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 check_command() {
-	which $1 >/dev/null 2>&1
+	which "$1" >/dev/null 2>&1
 }
 
 if check_command sha512sum; then
diff --git a/scripts/update-patches.sh b/scripts/update-patches.sh
index f8b92025f00576271fdf51979b5c6642979ef585..62d5bf78b5fd8a1c649f6e90bcbc81d8c2233991 100755
--- a/scripts/update-patches.sh
+++ b/scripts/update-patches.sh
@@ -8,14 +8,14 @@ shopt -s nullglob
 for module in $GLUON_MODULES; do
 	echo "--- Updating patches for module '$module' ---"
 
-	rm -f "$GLUONDIR"/patches/$module/*.patch
-	mkdir -p "$GLUONDIR"/patches/$module
+	rm -f "$GLUONDIR"/patches/"$module"/*.patch
+	mkdir -p "$GLUONDIR"/patches/"$module"
 
-	cd "$GLUONDIR"/$module
+	cd "$GLUONDIR"/"$module"
 
 	n=0
 	for commit in $(git rev-list --reverse --no-merges base..patched); do
 		let n=n+1
-		git show --pretty=format:'From: %an <%ae>%nDate: %aD%nSubject: %B' --no-renames $commit > "$GLUONDIR"/patches/$module/"$(printf '%04u' $n)-$(git show -s --pretty=format:%f $commit).patch"
+		git show --pretty=format:'From: %an <%ae>%nDate: %aD%nSubject: %B' --no-renames "$commit" > "$GLUONDIR/patches/$module/$(printf '%04u' $n)-$(git show -s --pretty=format:%f "$commit").patch"
 	done
 done
diff --git a/scripts/update.sh b/scripts/update.sh
index 1c750f693ddfd453597c973d0df85f61e47a6926..ae3368cb86940cce396ce3bc25444b703f3c302f 100755
--- a/scripts/update.sh
+++ b/scripts/update.sh
@@ -6,17 +6,17 @@ set -e
 
 for module in $GLUON_MODULES; do
 	echo "--- Updating module '$module' ---"
-	var=$(echo $module | tr '[:lower:]/' '[:upper:]_')
+	var=$(echo "$module" | tr '[:lower:]/' '[:upper:]_')
 	eval repo=\${${var}_REPO}
 	eval branch=\${${var}_BRANCH}
 	eval commit=\${${var}_COMMIT}
 
-	mkdir -p "$GLUONDIR"/$module
-	cd "$GLUONDIR"/$module
+	mkdir -p "$GLUONDIR/$module"
+	cd "$GLUONDIR/$module"
 	git init
 
-	if ! git branch -f base $commit 2>/dev/null; then
-		git fetch $repo $branch
-		git branch -f base $commit 2>/dev/null
+	if ! git branch -f base "$commit" 2>/dev/null; then
+		git fetch "$repo" "$branch"
+		git branch -f base "$commit" 2>/dev/null
 	fi
 done