#!/bin/sh VERSION=0.2.5 # a music player for the console, uses sox/play and find-utils if [ -f "$1" ] ;then if echo "$1" | grep -ie'cd' > /dev/null 2>&1 then eject -x 1 /dev/cdrom > /dev/null 2>&1 fi > /dev/null 2>&1 play "$1" > /dev/null 2>&1 elif [ -d "$1" ] ;then LIST=`find $1 -type f ` BOB="`for Q in $LIST ;do if file $Q | grep audio > /dev/null 2>&1 then echo "$RANDOM:$Q" ;fi ;done | sort | cut -d':' -f2-`" for NEXT in $BOB ;do echo " Now playing \"`echo "$NEXT" | tr '_' ' ' | cut -d'.' -f1`\"" music $NEXT > /dev/null 2>&1 done fi