Following script will look for all .mp3 files in the current directory and create .m3u playlist from them
Script:
#!/bin/sh DIR="./" SUFFIX="mp3" FILE_NAME="$1.m3u" echo "#EXTM3U" >> $FILE_NAME for i in "$DIR"/*.$SUFFIX do echo ${i%%} |sed 's#^.*/##' >> $FILE_NAME done |
Command:
sh script.sh FILENAME