Skip to content

Commit

Permalink
Merge pull request #81 from edquist/SOFTWARE-3589.escape-fixie
Browse files Browse the repository at this point in the history
escape existing quote characters first (SOFTWARE-3589)
  • Loading branch information
brianhlin authored May 15, 2019
2 parents 81de825 + 4e67757 commit 5ec24db
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/scripts/condor_submit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5ec24db

Please sign in to comment.