for i in *;
echo $b >> playlist; # the file names are stored in "playlist"
this way the names of all the files in all the subdirectories will be stored in "playlist" along with the appropriate path. Then we can play the list
as follows -
$ mpg321 --list playlist -z # -z for shuffle mode
That is it! Enjoy your music! Here we are assuming that all files are stored in various subdirectories of one parent directory, say 'music'. The script has to executed from the directory 'music'.