Skip to content
This repository has been archived by the owner on Oct 10, 2019. It is now read-only.

escape existing quote characters first (SOFTWARE-3589) #81

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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