From: paul Date: Wed, 14 Sep 2016 11:47:19 +0000 (+0000) Subject: use glob instead of ls for file listing X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=060c579743b7308fc19a9cf0d13ad269efc52a97;p=serve0 use glob instead of ls for file listing svn path=/trunk/; revision=149 --- diff --git a/pages/list.sh b/pages/list.sh index 70859d5..c376d68 100755 --- a/pages/list.sh +++ b/pages/list.sh @@ -95,9 +95,9 @@ VIDEOend genlist(){ case "$order" in - Date) ls -c "${_DATA}"/videos/ |egrep -i "$file_pattern";; + Date) stat -c '%Y %n' "${_DATA}"/videos/* |sort -r |sed -r 's;^.*/;;;' |egrep -i "$file_pattern";; Length) sed -sn 1p "${_DATA}"/meta/*.meta |sort -n |sed -r 's;^[0-9\t]+\t;;';; - Name) printf '%s\n' "${_DATA}"/videos/* |sed -r 's;^.*/;;;';; + Name) printf '%s\n' "${_DATA}"/videos/* |sed -r 's;^.*/;;;' |egrep -i "$file_pattern";; esac }