#!/bin/bash FIND=/usr/bin/find cd /srv/share/raw t=$(${FIND} . -type f -iname "*.mpg") if [ "$t" == "" ] then echo "There are no *.mpg files in /srv/share/raw/" exit 1 fi for f in *.mpg do OUTF=/srv/share/ready/$(echo "$f" | sed s/\.mpg$/.mp4/g) HandBrakeCLI -i $f -o $OUTF -b 2000 -B 192 -w 720 -l 405 --custom-anamorphic --display-width 720 --pixel-aspect 1:1 2>/dev/null/ mv $f ../ done