From af28517d73146f644aa9ef04343a0cc9e9759aca Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Thu, 28 Mar 2024 13:48:35 +0100 Subject: [PATCH] sort invoice list, newest to oldest --- invoices.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/invoices.sh b/invoices.sh index 9ed6dfa..d53ace7 100755 --- a/invoices.sh +++ b/invoices.sh @@ -34,7 +34,9 @@ list_invoices(){ for n in resent:Resent sent:Sent paid:Paid cancelled:Cancelled; do printf '[h1 %s]' "${n#*:}" - for i in invoices/*; do case "$(sed 1q <$i)" in + printf "%s\n" invoices/* \ + | sort -r \ + | while read i; do case "$(sed 1q <$i)" in *status=${n%:*}*) list_invoice "$i";; esac; done done -- 2.39.2