Public feed #376725

Something

public shellscript v1 · immutable
Raw Edit
·published 2007-03-01 06:38 UTC
rendered paste body
#!/bin/shVERSION=0.2.5# a music player for the console, uses sox/play and find-utilsif [ -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    donefi