From: Paul Hänsch Date: Tue, 26 Nov 2019 01:25:37 +0000 (+0100) Subject: replace non portable `line` command X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=07c2cf90c2194a7e010db30553f016ca6c1bcd05;p=invoices replace non portable `line` command --- diff --git a/invoices.sh b/invoices.sh index f8dbf85..a88bc7f 100755 --- a/invoices.sh +++ b/invoices.sh @@ -26,7 +26,7 @@ list_invoices(){ [ -d invoices/ ] || return 0 printf '[h1 Open]' - for i in invoices/*; do case "$(line <$i)" in + for i in invoices/*; do case "$(sed 1q <$i)" in *status=open*) list_invoice "$i";; *status=*) :;; *) list_invoice "$i";; @@ -34,7 +34,7 @@ list_invoices(){ for n in resent:Resent sent:Sent paid:Paid cancelled:Cancelled; do printf '[h1 %s]' "${n#*:}" - for i in invoices/*; do case "$(line <$i)" in + for i in invoices/*; do case "$(sed 1q <$i)" in *status=${n%:*}*) list_invoice "$i";; esac; done done