aboutsummaryrefslogtreecommitdiff
path: root/src/scripts/xzdiff.in
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2022-07-18 19:18:48 +0300
committerLasse Collin <lasse.collin@tukaani.org>2022-07-18 19:18:48 +0300
commitbad61b5997e6647911974022bfb72f3d4818a594 (patch)
tree77de708eaae140b4779e4598b4b0e2e39c865c4c /src/scripts/xzdiff.in
parentxzgrep: Add more LC_ALL=C to avoid bugs with multibyte characters. (diff)
downloadxz-bad61b5997e6647911974022bfb72f3d4818a594.tar.xz
Scripts: Use printf instead of echo in a few places.
It's a good habbit as echo has some portability corner cases when the string contents can be anything.
Diffstat (limited to 'src/scripts/xzdiff.in')
-rw-r--r--src/scripts/xzdiff.in6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/scripts/xzdiff.in b/src/scripts/xzdiff.in
index 78d75c09..234d6c70 100644
--- a/src/scripts/xzdiff.in
+++ b/src/scripts/xzdiff.in
@@ -51,7 +51,7 @@ escape='
while :; do
case $1 in
--h*) printf '%s\n' "$usage" || exit 2; exit;;
- --v*) echo "$version" || exit 2; exit;;
+ --v*) printf '%s\n' "$version" || exit 2; exit;;
--) shift; break;;
-*\'*) cmp="$cmp '"`printf '%sX\n' "$1" | sed "$escape"`;;
-?*) cmp="$cmp '$1'";;
@@ -83,7 +83,7 @@ if test $# -eq 1; then
*[-.]zst | *.tzst)
xz1='zstd -q';;
*)
- echo >&2 "$0: $1: Unknown compressed file name suffix"
+ printf '%s\n' "$0: $1: Unknown compressed file name suffix" >&2
exit 2;;
esac
case $1 in
@@ -193,7 +193,7 @@ elif test $# -eq 2; then
esac;;
esac
else
- echo >&2 "$0: Invalid number of operands; try \`${0##*/} --help' for help"
+ printf '%s\n' "$0: Invalid number of operands; try \`${0##*/} --help' for help" >&2
exit 2
fi