Converted to bash; use find -printf.

Pascal J. Bourguignon [2021-08-04 09:46]
Converted to bash; use find -printf.
Filename
lslast
diff --git a/lslast b/lslast
index 50d9a65..92ba98d 100755
--- a/lslast
+++ b/lslast
@@ -1,5 +1,19 @@
-#!/bin/csh -f -b
+#!/bin/bash

-	ls -1 | sort -t. +1n | tail -20
+# time=A  # Access
+# time=C  # Change
+time=T  # modificaTion

+function lslast(){
+	local args
+	if [ "$#" -eq 0 ] ; then
+		dirs=(.)
+	else
+		dirs=("$@")
+	fi
+	find "${dirs[@]}" -printf "%${time}Y%${time}m%${time}dT%${time}T %p\n" \
+	| sort -r \
+	| head -20
+}

+lslast "$@"
ViewGit