]> git.plutz.net Git - invoices/commitdiff
replace non portable `line` command
authorPaul Hänsch <paul@plutz.net>
Tue, 26 Nov 2019 01:25:37 +0000 (02:25 +0100)
committerPaul Hänsch <paul@plutz.net>
Tue, 26 Nov 2019 01:25:37 +0000 (02:25 +0100)
invoices.sh

index f8dbf8514dfb97bc2bb957b604ff0ff0242858ca..a88bc7fc59fc663892f198b92946407566f2f2cb 100755 (executable)
@@ -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