From ea5e382e6eab5d66850e781b99ae30c311b70baf Mon Sep 17 00:00:00 2001 From: gutmet Date: Thu, 14 May 2020 20:01:22 +0200 Subject: [PATCH] bugfixes --- cutAndShrinkVideo | 10 ++++++++-- cutVideo | 5 +++-- shrinkVideo | 5 +++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/cutAndShrinkVideo b/cutAndShrinkVideo index bd421be..ac0bb23 100755 --- a/cutAndShrinkVideo +++ b/cutAndShrinkVideo @@ -1,10 +1,16 @@ #!/bin/bash -cutFile="$(cutVideo $1 $2 $3)" +if [ "$#" -ne 3 ]; then + echo "USAGE: $0 FILE START DURATION" + exit 1 +fi + +cutFile="$(cutVideo "$1" "$2" "$3")" +echo "cutFile=$cutFile" status=$? if [ $status -eq 0 ]; then - echo "$(shrinkVideo $cutFile)" + echo "$(shrinkVideo "$cutFile")" status=$? if [ $status -eq 0 ]; then rm "$cutFile" diff --git a/cutVideo b/cutVideo index 1f62da9..db0f8d0 100755 --- a/cutVideo +++ b/cutVideo @@ -2,11 +2,12 @@ if [ "$#" -ne 3 ]; then echo "USAGE: $0 FILE START DURATION" + exit 1 fi fullpath="$1" -dir=`dirname $fullpath` -filename=`basename $fullpath` +dir=`dirname "$fullpath"` +filename=`basename "$fullpath"` extension="${filename##*.}" filename="${filename%.*}" outfile="$dir/$filename""Cut.$extension" diff --git a/shrinkVideo b/shrinkVideo index 68f1ed4..ba3de25 100755 --- a/shrinkVideo +++ b/shrinkVideo @@ -2,11 +2,12 @@ if [ "$#" -ne 1 ]; then echo "USAGE: $0 FILE" + exit 1 fi fullpath="$1" -dir=`dirname $fullpath` -filename=`basename $fullpath` +dir=`dirname "$fullpath"` +filename=`basename "$fullpath"` filename="${filename%.*}" outfile="$dir/$filename""Shrunk.mp4"