diff --git a/arch-nspawn.in b/arch-nspawn.in
index 3949ee1cae620ee1c4bc2b81ddaabad7b9fe5ba0..7a7a27426808afaffd30779377fba0891d433d1c 100644
--- a/arch-nspawn.in
+++ b/arch-nspawn.in
@@ -91,7 +91,7 @@ copy_hostconf () {
 		cp -T "$file" "$working_dir$file"
 	done
 
-	sed -r "s|^#?\\s*CacheDir.+|CacheDir = $(echo -n "${cache_dirs[@]}")|g" -i "$working_dir/etc/pacman.conf"
+	sed -r "s|^#?\\s*CacheDir.+|CacheDir = ${cache_dirs[*]}|g" -i "$working_dir/etc/pacman.conf"
 }
 # }}}