#!/bin/bash

# for finding and executing music in mplayer
# replace ‘/my/Music/Collection/’with real path of the folder your music is stored. ‘/*/*/*’ are given to look into sub folders

song=$*

#for playing all songs in shuffled manner
if [[ “$song” == “all” ]];then
{
mplayer -shuffle /my/Music/Collection/* /my/Music/Collection/*/* /my/Music/Collection/*/*/* /my/Music/Collection/*/*/*/* /my/Music/Collection/*/*/*/*/* /my/Music/Collection/*/*/*/*/*/*
}
else  
#for finding and playing the song name given
{
find /my/Music/Collection/ -type f -iname “*$song*” -exec mplayer {} \;
}
fi

Advertisements