diff options
author | shdown <shdownnine@gmail.com> | 2014-09-16 21:01:35 +0400 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-09-17 00:00:05 +0200 |
commit | f2c46bc1d1c17fb26f1258fef1c7a9aa12e74590 (patch) | |
tree | b3929c50142872e570ac997edc6d194836a0e810 /TOOLS/mpv_identify.sh | |
parent | 02d0b2f31ca49649c73e01438b85c29dda709fdb (diff) | |
download | mpv-f2c46bc1d1c17fb26f1258fef1c7a9aa12e74590.tar.bz2 mpv-f2c46bc1d1c17fb26f1258fef1c7a9aa12e74590.tar.xz |
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.
Diffstat (limited to 'TOOLS/mpv_identify.sh')
-rwxr-xr-x | TOOLS/mpv_identify.sh | 30 |
1 files changed, 16 insertions, 14 deletions
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 <<EOF +Usage 1 (for humans only): $0 filename.mkv +will print all property values. +Note that this output really shouldn't be parsed, as the +format is subject to change. + +Usage 2 (for use by scripts): see top of this file + +NOTE: for mkv with ordered chapters, this may +not always identify the specified file, but the +file providing the first chapter. Specify +--no-ordered-chapters to prevent this. +EOF + return 2 fi local LF=" @@ -116,7 +118,7 @@ __midentify__main() { done else if [ "$fileindex" -gt 0 ]; then - echo + printf '\n' fi fileindex="$((fileindex+1))" fi @@ -134,7 +136,7 @@ __midentify__main() { fi else if [ -n "$value" ]; then - echo "$key=$value" + printf '%s=%s\n' "$key" "$value" fi fi ;; |