I have a script such as following
DIR=$1
ls $1 |sort -R |tail -$5 |while read file; do
soxi -d $1$file
done
and it gives me an output like
00:40:35.18
00:43:41.23
01:04:19.64
00:59:41.92
00:51:16.32
As you can see, the program picks a random file (audio) from the folder and checks the time for each file. However, I need the sum of the length of all the audios.
How can I get the total number of audio files?