summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2019-03-18 00:55:33 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2019-03-18 00:55:33 (EDT)
commit362fdf512ac720a50a1c1a49bc4637cc16f63d19 (patch)
treeffa86bca3181fd294ae15c8bd63c71df794cc544
parent4bd7b3573b9d69b4b4164946d8c4b99a9ac63006 (diff)
ob_set_substvar(): Replace echo with a here-document
-rw-r--r--lib/control.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/control.sh b/lib/control.sh
index 3395294..ab37ef3 100644
--- a/lib/control.sh
+++ b/lib/control.sh
@@ -201,7 +201,7 @@ ob_set_substvar()
)"
# Trim leading and trailing whitespace from value.
- value="$(echo "${value}" | sed -n '
+ 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,
@@ -209,7 +209,10 @@ ob_set_substvar()
s/[\n]*$//; # remove trailing newline characters, and
p; # print the results.
};
- ')"
+ ' <<-EOF
+ ${value}
+ EOF
+ )"
eval "_OB_SUBSTVAR_${name}=\"\${value}\""