From 4e67757db61241ac8953294edacb4a6a352bdfd5 Mon Sep 17 00:00:00 2001 From: Carl Edquist Date: Wed, 15 May 2019 14:53:33 -0500 Subject: [PATCH] escape existing quote characters first (SOFTWARE-3589) that is, before adding surrounding quotes --- src/scripts/condor_submit.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/scripts/condor_submit.sh b/src/scripts/condor_submit.sh index 194bb1b9..697286a1 100755 --- a/src/scripts/condor_submit.sh +++ b/src/scripts/condor_submit.sh @@ -206,12 +206,12 @@ if [ "x$environment" != "x" ] ; then eval "env_array=($environment)" dq='"' sq="'" - # map key=val -> key='val' - env_array=("${env_array[@]/=/=$sq}") - env_array=("${env_array[@]/%/$sq}") # escape single-quote and double-quote characters (by doubling them) env_array=("${env_array[@]//$sq/$sq$sq}") env_array=("${env_array[@]//$dq/$dq$dq}") + # map key=val -> key='val' + env_array=("${env_array[@]/=/=$sq}") + env_array=("${env_array[@]/%/$sq}") submit_file_environment="environment = \"${env_array[*]}\"" else if [ "x$envir" != "x" ] ; then