From c14e5780068625391ed8ef632b728add2e6c9ce5 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Mon, 18 Mar 2019 16:03:24 -0400 Subject: ob_set_source_substvar(): Replace here-documents with printf --- diff --git a/lib/control.sh b/lib/control.sh index b5cc5d6..cd982e9 100644 --- a/lib/control.sh +++ b/lib/control.sh @@ -197,13 +197,10 @@ ob_set_source_substvar() case "${name}" in *[!A-Za-z0-9-]* | '') return 1 esac - name="$(tr 'a-z-' 'A-Z_' <<-EOF - ${name} - EOF - )" + name="$(printf '%s' "${name}" | tr 'a-z-' 'A-Z_')" # Trim leading and trailing whitespace from value. - value="$(sed -n ' + value="$(printf '%s' "${value}" | sed -n ' H; # Store each input line in the hold space. ${ # At the last line of input: g; # restore the hold space into the pattern space, @@ -211,10 +208,7 @@ ob_set_source_substvar() s/[\n]*$//; # remove trailing newline characters, and p; # print the results. }; - ' <<-EOF - ${value} - EOF - )" + ')" eval "_OB_SUBSTVAR_${name}=\"\${value}\"" -- cgit v0.9.1