From: Paul Hänsch Date: Thu, 28 Mar 2024 12:48:35 +0000 (+0100) Subject: sort invoice list, newest to oldest X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;ds=sidebyside;p=invoices sort invoice list, newest to oldest --- 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