From aa9350268d19583c846a8229958f9dd26e5f5aae Mon Sep 17 00:00:00 2001 From: "dylan.araps@gmail.com" Date: Tue, 28 Jan 2020 22:41:44 +0000 Subject: kiss: use printf instead of echo FossilOrigin-Name: 2e38ecf2a3e24e2cd6490171d3343175abf3c2d4bf08847a5a963ade8547e735 --- kiss | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'kiss') diff --git a/kiss b/kiss index 9151c6a..bb7b891 100755 --- a/kiss +++ b/kiss @@ -152,8 +152,8 @@ regex_escape() { # Escape all required characters in both the search and # replace portions of two strings for use in a 'sed' call # as "plain-text". - sea=$(echo "$1" | sed 's/[]\/$*.^[]/\\&/g') - rep=$(echo "$2" | sed 's/[\/&]/\\&/g') + sea=$(printf %s "$1" | sed 's/[]\/$*.^[]/\\&/g') + rep=$(printf %s "$2" | sed 's/[\/&]/\\&/g') } pkg_lint() { @@ -556,7 +556,7 @@ pkg_build() { # There's no better way to remove a word from a string in # POSIX 'sh' sadly. contains "$deps" "$pkg" && - explicit=$(echo "$explicit" | sed "s/ $pkg / /g") + explicit=$(printf %s "$explicit" | sed "s/ $pkg / /g") done # See [1] at top of script. @@ -601,7 +601,7 @@ pkg_build() { # list. No better way than using 'sed' in POSIX 'sh'. # See [1] at top of script. # shellcheck disable=2046,2086 - set -- $(echo " $* " | sed "s/ $pkg / /") + set -- $(printf %s " $* " | sed "s/ $pkg / /") } } done @@ -825,7 +825,7 @@ pkg_conflicts() { # Construct the file name of the "db" entry of the # conflicting file. (pkg_name>usr>bin>ls) - con_name=$(echo "$con" | sed 's|/|>|g') + con_name=$(printf %s "$con" | sed 's|/|>|g') # Move the conflicting file to the choices directory # and name it according to the format above. -- cgit v1.2.3