summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-09-01 14:49:50 (EDT)
committer P. J. McDermott <pj@pehjota.net>2014-09-01 14:49:50 (EDT)
commit5d950c81d9073daa2478a7724459f95ccf15fb03 (patch)
tree89e329a8293418c6bf79dc1abbf8971b6da400fb
parenta430cad99211b501cfcc99a009cc30acb9e76902 (diff)
set_substvar(): Use printf instead of echo
-rw-r--r--lib/substvars.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/substvars.sh b/lib/substvars.sh
index ee7e860..5ef662b 100644
--- a/lib/substvars.sh
+++ b/lib/substvars.sh
@@ -29,7 +29,7 @@ set_substvar()
local value="${2}"
# Convert variable name to lower case and validate.
- name="$(echo "${name}" | tr 'A-Z-' 'a-z_')"
+ name="$(printf '%s\n' "${name}" | tr 'A-Z-' 'a-z_')"
case "${name:- }" in
*[!a-z0-9_]*)
error 2 "$(get_msg 'substvar_invalid')" "${name}"