On Wed, 2011-06-08 at 04:36 -0400, Charles Philip Chan wrote:
Gary Hodder <vk2kcf@vk2kcf.com> writes:
can somebody help me with a script using mp3info that will only print out number of files in a directory and number of files with a bit rate of less than 192k.
Off the top of my head, you can do something like this:
#!/bin/sh count=0 count1=0 for i in *.mp3 do count=`expr $count + 1` rate=`mp3info -p "%r" "$i"` if [ $rate -lt 192 ]; then count1=`expr $count1 + 1`; fi done echo "Total number of mp3 files: $count" echo "Total number of mp3 files < 192 kbps: $count1"
Charles
Hi Charles, I got the below from your script. ./192check: line 8: [: Variable: integer expression expected ./192check: line 8: [: Variable: integer expression expected Total number of mp3 files: 2169 Total number of mp3 files < 192 kbps: 1108 Guessing here line 8 the rate, is the mp3 doesn't contain bit rate in the id3 tag? In another directory it picked up a corrupted mp3 and named it, excellent thank you very much. Gary. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org