Plan 9 from Bell Labs’s /usr/web/sources/contrib/john/mkmusiclist

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/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
}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].