#!/bin/rc
#there are probably better names and better choices for directories,
#but I'll stick with these for now.
musicroot = /usr/john/www
musicdir = music
cd $musicroot
#This is so I'm safe
echo '<p>These files are reserved for the EXCLUSIVE use of John Floren.</p>' > music.html
#stupid default...
first = ☺
for (i in `{du -a $musicdir | grep mp3 | awk '{print $2}' | sort -f}) {
this = `{ls -p $i}
nfirst = `{echo $this | awk '{print toupper(substr($1, 1, 1))}'}
if (! ~ $nfirst $first) {
echo -n '<h3>' >> music.html
echo -n $nfirst >> music.html
echo '</h3>' >> music.html
first = $nfirst
}
echo -n '<a href="' >> music.html
echo -n $i>> music.html
echo -n '">' >> music.html
echo -n $this >> music.html
echo '</a><br>' >> music.html
}
|