then shift && i=1; while test $i -le ${1:-9}; do $0 make "${2:-Ω}$i" "empty$i"; ((i++)); done
else echo ${2:-empty} >$1.m3u8
fi;;
(fix) sed -i 's/.*\/musi[kc]/../g';;
(cd) dir=${2:-cd}
mkdir $dir
cat $1 | python -c "import sys, urllib as ul; [sys.stdout.write(ul.unquote_plus(l)) for l in sys.stdin]" | sed '=' | sed -r 's/^[0-9]$/0\0/' | sed -r "N; s/(.*)\n(.*\/[0-9 ]*(.*))/'\2'\n'$dir\/\1 \3'/" | xargs -L 2 cp;;
(*) echo "Unknown subcommand '$1' - Possible subcommands:
update - update file paths for moved songs in a playlist
edit - open playlist in default editor
make - create an empty playlist with given name in current directory (optional second arg provides content)
> d - creates up to 9 dummy files
fix - replace absolute by relative paths for all given files (assumes library root at musi[kc] and playlist file one level below)
cd - copy all songs of a playlist into a folder with indexed names, so they can easily be burned to a CD"