diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-03-12 22:02:58 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-03-12 22:02:58 (EDT) |
commit | 6cc474f990a3c62804facb2a254217d9b69058d1 (patch) | |
tree | 4969049f8686e25759468031d4c08be2a74e9f73 /lib/control.sh | |
parent | ab9200cc0e1166eeeef7690fa6a67a8d8ce07c5c (diff) |
lib/control.sh, lib/package.sh: Replace echo with here-document in tr commands
Diffstat (limited to 'lib/control.sh')
-rw-r--r-- | lib/control.sh | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/control.sh b/lib/control.sh index 3bcedbc..58bf68b 100644 --- a/lib/control.sh +++ b/lib/control.sh @@ -214,7 +214,10 @@ ob_set_substvar() case "${name}" in *[!A-Za-z0-9-]* | '') return 125 esac - name="$(echo "${name}" | tr 'a-z-' 'A-Z_')" + name="$(tr 'a-z-' 'A-Z_' <<-EOF + ${name} + EOF + )" # Trim leading and trailing whitespace from value. read -r value <<-EOF @@ -289,7 +292,10 @@ ob_substvars() esac # Perform the substitution. - name="$(echo "${name}" | tr 'a-z-' 'A-Z_')" + name="$(tr 'a-z-' 'A-Z_' <<-EOF + ${name} + EOF + )" value="$(eval "printf '%s' \"\${_OB_SUBSTVAR_${name}}\"")" string="${lhs}${value}${rhs}" depth=$(($depth + 1)) |