#!/bin/zsh src="/dev/dvd" out="/home/tdn/Video" msg="Insert new DVD and press Y to continue. Press N to stop." echo $msg cnt=0 while read -q; do (( cnt++ )) echo "Iteration $cnt" echo echo "Enter file name" read name dst=$out/$name.m4v echo "Video will be written to: $dst" echo echo "-------------------------------" echo HandBrakeCLI -i $src -o $dst -v -m -E aac,ac3 -e x264 nice HandBrakeCLI -i $src -o $dst -v -m -E aac,ac3 -e x264 #exit echo eject $src echo "Ripping done." echo echo echo $msg done