From 71ae5733aed9cac8df7aa1c92769032a8c6892d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Tue, 15 Feb 2022 23:35:05 +0100 Subject: [PATCH] save --- init.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/init.sh b/init.sh index 9d737b8..ae3d289 100755 --- a/init.sh +++ b/init.sh @@ -1,9 +1,9 @@ #!/bin/bash { source config -find -type f | xargs sed -i "s/\$mainfile/${mainfile}/g" -find -type f | xargs sed -i "s/\$course/${course}/g" -find -type f | xargs sed -i "s/\$stylefile/${stylefile}/g" -find -type f | xargs sed -i "s/\$repo/${repo}/g" -find -type f | xargs sed -i "s/\$term/${term}/g" +find -type f | xargs sed -i "s/\$mainfile/$(printf '%s\n' "$mainfile" | sed -e 's/[\/&]/\\&/g')/g" +find -type f | xargs sed -i "s/\$course/$(printf '%s\n' "$course" | sed -e 's/[\/&]/\\&/g')/g" +find -type f | xargs sed -i "s/\$stylefile/$(printf '%s\n' "$stylefile" | sed -e 's/[\/&]/\\&/g')/g" +find -type f | xargs sed -i "s/\$repo/$(printf '%s\n' "$repo" | sed -e 's/[\/&]/\\&/g')/g" +find -type f | xargs sed -i "s/\$term/$(printf '%s\n' "$term" | sed -e 's/[\/&]/\\&/g')/g" }