Donate Share

BashBurn

Tracker: Bugs

5 func/audiofunc.sh mp3 detection - ID: 1696022
Last Update: Comment added ( mazdac )

mp3/ogg/flac detection didn't work for me, it returned this error if no
mp3s were found:
/usr/local/BashBurn/func/audiofunc.sh: line 25: [: -gt: unary operator
expected
and this if more than one were found:
/usr/local/BashBurn/func/audiofunc.sh: line 25: [: too many arguments
so i figured out that when it finds some files, bash expands
if [ $(find ${BBBURNDIR} -iname "*.[Mm][Pp]3") -gt 0 ]; then
to something like
if [ file1.mp3 file2.mp3 file3.mp3 -gt 0 ]; then
which causes the too many arguments error. changing line 25 (and the
similar lines for ogg and flac) to this fixed it for me:
RES=`find ${BBBURNDIR} -iname "*.[Mm][Pp]3" &>/dev/null`
if [ "$RES" != 0 ]; then
but i'm not that good at bash so there's probably a better way to do that.

hope this helps


mips ( mips_tian ) - 2007-04-07 12:33

5

Open

None

Nobody/Anonymous

None

None

Public


Comments ( 2 )




Date: 2007-07-26 21:38
Sender: mazdac


or more minialistic (without using wc):

if [ -n "$(find ${BBBURNDIR} -iname "*.[Mm][Pp]3")" ]


Date: 2007-06-09 14:16
Sender: nobody

Logged In: NO

it works if you write line 25 (and, of course, the same to ogg and flac)
like this:

if [ $(find ${BBBURNDIR} -iname "*.[Mm][Pp]3" | wc -l) -gt 0 ]
^^^^^^^



Log in to comment.

Attached File

No Files Currently Attached

Change

No changes have been made to this artifact.