From 71a242e1d6405324cd0679d158d65b65447f138a Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Fri, 11 Oct 2024 10:52:27 -0400 Subject: [PATCH] Added double-slash to escape _all_ forward slashes --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 4b31af2..fa4150d 100755 --- a/build.sh +++ b/build.sh @@ -144,7 +144,7 @@ add_header_and_footer_to_index() { replace_vars() { # Loop through the keys of the 'meta_array' array, search for all occurences of the key in the HTML doc, and replace them with the corresponding value.. for arr_key in "${!meta_array[@]}"; do - meta_array["$arr_key"]="${meta_array["$arr_key"]/\//\\/}" # Escape all forward slashes in the value + meta_array["$arr_key"]="${meta_array["$arr_key"]//\//\\/}" # Escape all forward slashes in the value sed -i "s/[\$][\$]$arr_key[\$][\$]/${meta_array[$arr_key]}/g" "$1" done