dotfiles

<-- duh.
Log | Files | Refs | LICENSE

commit 4b4b254f556bafb64161a008c0fe5ce580cd9b86
parent 317273f2a0046575a4e62b6bcc3e0f2c0811892a
Author: hhvn <dev@haydenvh.com>
Date:   Thu, 11 Mar 2021 00:01:31 +0000

.s/o/tac: support multiple files

Woops, forgot it didn't just read stdin :)

Diffstat:
M.scripts/openbsd-compat/tac | 28+++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)

diff --git a/.scripts/openbsd-compat/tac b/.scripts/openbsd-compat/tac @@ -1,14 +1,20 @@ -#!/bin/awk -f +#!/bin/sh -BEGIN { - n=0 -} +while [ $# -ne 0 ] +do + printf '%s\n' "$1" + shift +done | nl | sort -nr | sed 's/^[[:space:]]*[0-9]*[[:space:]]//' |\ + tr '\n' '\0' | xargs -0 cat | awk ' + BEGIN { + n=0 + } -{ - line[n++]=$0 -} + { + line[n++]=$0 + } -END { - for (i=n; i != 0; i--) - print line[i-1] -} + END { + for (i=n; i != 0; i--) + print line[i-1] + }'