From S1MP3 Wiki
#!/bin/sh -ue
# http://wiki.s1mp3.org/S1mp3ls -- On GNU/Linux List S1MP3 files in the same
# native order as seen on the player's display.
# Copyright : http://www.fsf.org/copyleft/gpl.html
# Author : Dan Jacobson http://jidanni.org/
# Created On : Mon Feb 11 11:11:49 2008
# Last Modified On: Thu Dec 11 23:58:15 2008
# Update Count : 56
test $# -eq 1||{ echo Usage: $0 S1MP3_root_directory 1>&2; exit 1;}
cd $1; echo `basename $0` $1 `LC_ALL=C date`
set -- `find -type d ! -empty`
for types in 'MP3 WMA OGG ASF' 'WAV ACT' #"MUSIC" and "VOICE" modes; all?
do echo === $types ===
for d
do for type in $types
do find $d -maxdepth 1 -iname \*.$type -printf %f\\n
done|perl -nwe '$l.=sprintf "%03d $_", $.;
END{if($.){$_="'$d'"; s@^\./?@@; s@$@/@; print "$_\n$l"}}'
done
echo
done
#The above was all worked out via trial and error.
#Using File::Find, or reading ID3 tags would only add complexity.
#Preliminary investigation of a different player that presents all songs as
#a single flat list no matter how deep nested:
#find $1 -type f -printf '%f\n'|perl -nwe 'printf "%03d %s", $., $_;'
#But should divide voice vs. music