From: paul Date: Wed, 14 Sep 2016 12:31:20 +0000 (+0000) Subject: avoid even globs and use find for listings (because of arg/env limitation) X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=40e3b00e9750af97ddb9a16ac7f2e1410afe2c4f;p=serve0 avoid even globs and use find for listings (because of arg/env limitation) svn path=/trunk/; revision=150 --- diff --git a/pages/list.sh b/pages/list.sh index c376d68..37f764e 100755 --- a/pages/list.sh +++ b/pages/list.sh @@ -95,9 +95,9 @@ VIDEOend genlist(){ case "$order" in - Date) stat -c '%Y %n' "${_DATA}"/videos/* |sort -r |sed -r 's;^.*/;;;' |egrep -i "$file_pattern";; + Date) find "${_DATA}"/videos/ -maxdepth 1 -mindepth 1 -printf '%T@ %f\n' |sort -r |cut -d\ -f2- |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;^.*/;;;' |egrep -i "$file_pattern";; + Name) find "${_DATA}"/videos/ -maxdepth 1 -mindepth 1 -printf '%f\n' |sort |egrep -i "$file_pattern";; esac }