diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/control.sh | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/control.sh b/lib/control.sh index 9e8bb71..a20ea3c 100644 --- a/lib/control.sh +++ b/lib/control.sh @@ -215,16 +215,9 @@ ob_set_substvar() esac # Trim leading and trailing whitespace from value. - # TODO: "read" can probably do this more simply. - value="$(echo "${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, - s/^[\n]*//; # remove leading newline characters, - s/[\n]*$//; # remove trailing newline characters, and - p; # print the results. - }; - ')" + read -r value <<-EOF + ${value} + EOF eval "_OB_SUBSTVAR_${name}=\"\${value}\"" |