#!/bin/bash if [ -z $H ] then echo -e "usage:\tH=4 bash $0" exit 1 fi i=0 while ffmpeg -ss ${i}:00:00 -t 1:00:00 -i HPMoR_Part_${H}.mp3 h/hpmot_p${H}_h${i}.mp3 do if [ `du -t 5K h/hpmot_p${H}_h${i}.mp3 |wc -l` -lt 1 ] then rm h/hpmot_p${H}_h${i}.mp3 break fi let i++ done