X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=scripts.git;a=blobdiff_plain;f=dirtohtml.sh;h=0c7315a18dd8ee866515de78f82d27b988c70ead;hp=40c276714cc88105b9e64a251d5d24309607a90c;hb=cc99dcb03c99868af8e28dad388fe6e5b733b0a1;hpb=78d6c0bc5fb5033c2ad8235fac4f2da27230850f diff --git a/dirtohtml.sh b/dirtohtml.sh index 40c2767..0c7315a 100755 --- a/dirtohtml.sh +++ b/dirtohtml.sh @@ -47,18 +47,14 @@ echo echo "
"
 
-for d in $(find . -maxdepth 1 -type d -name "[^.]?*" | \
-    awk '{print $1" "$1}' | \
-    sed -e "s/^[^0-9]*//" | \
-    sort -g | \
-    awk '{print $2}'); do
+for d in $(find . -maxdepth 1 -type d -name "[^.]?*"); do
 
-    most_recent=$(find ${d} -type f -exec stat --printf="%y %n\n" '{}' \; | sort | tail -1 | awk '{print $4}')
+    most_recent=$(find ${d} -type f -exec stat --printf="%Y %n\n" '{}' \; | sort | tail -1 | awk '{print $4}')
 
     if [[ ${most_recent} ]]; then
-        date=$(stat --printf="%y" ${most_recent})
+        date=$(date -r ${most_recent})
     else
-        date=$(stat --printf="%y" ${d})
+        date=$(date -r ${d})
     fi
 
     echo "${date} ${d}"