Created
May 20, 2013 20:35
-
-
Save tobybaier/5615294 to your computer and use it in GitHub Desktop.
when offering MP3s (own material, of course, not pirated stuff) in multiple directories, I use this bash script to show all MP3s of a directory (dir name as first and only parameter to the script call) as an HTML file with HTML5 audio player and download links. Also adds the page to a list of directories.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd $1 | |
for i in `ls *.mp3`; do echo "<li><audio preload="none" controls="controls"><source src='$i' type='audio/mp3'/></audio> <a href='$i'>download $i</a></li>" >> index.html; done; | |
cd .. | |
echo "<li><a href='$1'>$1</a></li><br>" >> index.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment