From 5ed752bb2e62ec154e0569bb94b3fdcd0f77ce3a Mon Sep 17 00:00:00 2001 From: Guillermo Ramos Date: Fri, 8 May 2020 14:25:53 +0200 Subject: [PATCH] Escape values from env_file --- out | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/out b/out index 205699a..f0fa1f6 100755 --- a/out +++ b/out @@ -55,7 +55,7 @@ if [ -f "$env_file" ]; then # export key=value, when value as space but no quotes search_key_val='(\w+)=([^\n]+)' - source <(sed -E -n -r "s/$search_key_val/export \1=\"\2\"/ p" "$env_file") + source <(sed -En -e 's/(["\`$])/\\\1/g' -e "s/$search_key_val/export \1=\"\2\"/ p" "$env_file") fi cert_count="$(echo $raw_ca_certs | jq -r '. | length')"