#!/bin/bash echo "Scanning ${1}" cd ${1} find "." -type f -iregex ".*\.\(mp4\|mp3\|avi\|m4v\|aac\|mkv\|mov\|webm\|wmv\|flv\|m4a\)" -fprint ${2}.m3u # find "." -type f -iregex ".*\.\(mp4\|mp3\|avi\|m4v\|aac\|mkv\|mov\|webm\|wmv\|flv\|m4a\)" -printf "%T@ ./%f\n" | sort | cut -d' ' -f2 > ${2}.m3u