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"