You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
550 B
23 lines
550 B
#!/bin/sh -e |
|
|
|
if [ $# -le 1 ] |
|
then |
|
printf "This script will take two variables and convert all audio files of the first format to the second, using ffmpeg. \n" |
|
elif [ $# -ge 3 ] |
|
then |
|
printf "You've entered too many variables. We only need two... did you not check the help? \n" |
|
else |
|
i=`ls | grep $1 | wc -l` |
|
p=1 |
|
|
|
mkdir $2 |
|
|
|
while [ $p -le $i ] |
|
do |
|
x=`ls | sed "$p!d"` |
|
y=`printf "$x" | sed "s/$1/$2/"` |
|
yes | ffmpeg -i "$x" "$y" |
|
mv "$y" $2/ |
|
p=$(( $p + 1 )) |
|
done |
|
fi
|
|
|