From f065642278f658c514afb41c059bd4bd40eda207 Mon Sep 17 00:00:00 2001 From: Eric Torres Date: Mon, 22 Oct 2018 10:48:15 -0700 Subject: [PATCH] Changed exit code, add correctness check --- audiotrim.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/audiotrim.sh b/audiotrim.sh index c358da1..cf133e4 100755 --- a/audiotrim.sh +++ b/audiotrim.sh @@ -22,7 +22,7 @@ while true; do ;; --) shift - continue + break ;; *) break @@ -36,7 +36,7 @@ readonly stoptime="${3}" readonly outfile="${4}" readonly format="${1%.*}" -[[ -z "${infile}" ]] && printf '%s\n' "No file entered." >&2 exit 1 -[[ ! -f "${infile}" ]] && printf '%s\n' "Not a file: ${infile}" >&2 exit 2 +[[ -z "${infile}" ]] && printf '%s\n' "No file entered." >&2 exit 2 +[[ ! -f "${infile}" ]] && printf '%s\n' "Not a file: ${infile}" >&2 exit 3 ffmpeg -i "${infile}" -ss "${starttime}" -to "${stoptime}" -c copy "${outfile:-"${outfile%.*}-trimmed.${format}"}"