Randomfile

Hi friends,
I have created this little script that chooses a random file from a directory and copies it to another dir.
I use it to have a different wakeup song every day! It works great, try it :)
#!/system/bin/sh
echo
if test "$1" = ""; then
echo "Randomfile script by Uranya <uranya@inwind.it> v 1.0.0 16.08.2013"
echo "Usage:"
echo "sh randomfile.sh <sourcedir> <extension> <destdir>"
exit 1
fi
dirs=$1
ext=$2
dird=$3'/'
dest=$dird'random'.$ext
last='last.txt'
# create filename's array
list=($dirs/*.$ext)
# count number of files
num=${#list[@]}
# generate random number in range 1-NUM
let "ran=(${RANDOM} % ${num})+ 1"
echo Random number is $ran
sour=${list[ran]}
echo >$dird$last Last file is $sour
echo Last file is $sour
# copy the file
cp "$sour" $dest
Hope to be helpful, enjoy!