#!/bin/sh help(){ echo "Usage: $0 " exit 0 } if test "$#" = "1" then case $1 in *.m2t) base=`echo $1 | sed "s/.m2t$//"` frmt="hdv" extn="m2t" ;; *) help ;; esac echo Capturing $base$i$j.$extn... dvgrab --format $frmt --noavc -s 0 $base else help fi