Skip to content

Commit 8b10f36

Browse files
committed
Fixed quote handling in flux.sh
1 parent 9f12f7c commit 8b10f36

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/scripts/flux.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,13 @@ java_opts=$( echo "$java_opts" | sed "$substitute_vars_script")
4545
# Turn java options string into an array to allow passing
4646
# the options as command parameters. Options may be partially
4747
# quoted with single or double quotes and may contain
48-
# escape sequences:
48+
# escape sequences. Quotes are removed after splitting because
49+
# the shell quotes the parameters again:
4950
option_pattern="[^\"' ]*(\"[^\"\\]*(\\\\.[^\"\\]*)*\"|'[^'\\]*(\\\\.[^'\\]*)*'|\\.[^\"' ]*)*"
51+
remove_quotes="s/(^[\"'])|(([^\\])[\"'])/\3/g"
5052
java_opts_array=()
5153
while read line ; do
54+
line=$( echo "$line" | sed -r "$remove_quotes" )
5255
java_opts_array+=("$line")
5356
done < <( echo "$java_opts" | grep -Eo "$option_pattern" )
5457

0 commit comments

Comments
 (0)