From f2c46bc1d1c17fb26f1258fef1c7a9aa12e74590 Mon Sep 17 00:00:00 2001 From: shdown Date: Tue, 16 Sep 2014 21:01:35 +0400 Subject: TOOLS: eliminate echoes with variable substitutions echo behaviour with backslash escapes seems to be non-portable: dash does expand such an escapes and bash does not, so use cat/printf instead. --- TOOLS/idet.sh | 4 ++-- TOOLS/mpv_identify.sh | 30 ++++++++++++++++-------------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/TOOLS/idet.sh b/TOOLS/idet.sh index 9a2e698ea9..c3b30080a6 100755 --- a/TOOLS/idet.sh +++ b/TOOLS/idet.sh @@ -39,7 +39,7 @@ judge() case "$tff$bff$progressive$undetermined" in *[!0-9]*) - echo >&2 "ERROR: Unrecognized idet output: $out" + printf >&2 'ERROR: Unrecognized idet output: %s\n' "$out" exit 16 ;; esac @@ -75,7 +75,7 @@ judge() verdict="progressive" fi - echo "$verdict" + printf '%s\n' "$verdict" } judge "$@" --vf-clr diff --git a/TOOLS/mpv_identify.sh b/TOOLS/mpv_identify.sh index 4d72198e99..0f5fc64729 100755 --- a/TOOLS/mpv_identify.sh +++ b/TOOLS/mpv_identify.sh @@ -27,18 +27,20 @@ __midentify__main() { esac if [ "$#" -lt 2 ]; then - echo >&2 "Usage 1 (for humans only): $0 filename.mkv" - echo >&2 "will print all property values." - echo >&2 "Note that this output really shouldn't be parsed, as the" - echo >&2 "format is subject to change." - echo >&2 - echo >&2 "Usage 2 (for use by scripts): see top of this file" - echo >&2 - echo >&2 "NOTE: for mkv with ordered chapters, this may" - echo >&2 "not always identify the specified file, but the" - echo >&2 "file providing the first chapter. Specify" - echo >&2 "--no-ordered-chapters to prevent this." - return 1 + cat >&2 <