diff --git a/camrectoavi.sh b/camrectoavi.sh index cd6fb88..c8e9d28 100755 --- a/camrectoavi.sh +++ b/camrectoavi.sh @@ -4,8 +4,8 @@ set -e # Arg parser while [ ! $# == 0 ]; do case "$1" in - -o | --output) shift; OUTPUT=$1;; - *) + -o | --output) shift; OUTPUT=$1;; + *) if [[ -f $1 ]]; then INPUT=$1 else @@ -26,7 +26,7 @@ done ################# # Make tempdir -TMPDIR="/tmp/$(echo "$INPUT" | sed 's/\(.*\)\..*/\1/')-$RANDOM" +TMPDIR="/tmp/$(basename "$INPUT" | sed 's/\(.*\)\..*/\1/')-$RANDOM" mkdir "$TMPDIR" # Extract camrec file