flfederation For some reason though, col is segfaulting on OpenBSD.
OpenBSD, too, eh? Then that's 4 for 4. On all the OSes I tried--Ubunto 19.02, FreeBSD-12.1-RELEASE and NetBSD 9.0_STABLE--col(1)
failed miserably if the input string contained no \n
. On Ubuntu and FreeBSD, col
segfaulted; on NetBSD it did not deign to produce any output.
At first, I thought that it was because col
was tricky to implement correctly, but, it turned out to be common pedigree: All of them derive from code contributed to the original 4.x BSD.
The output you saw was on FreeBSD after I'd patched it. I've sent patches upstream for FreeBSD and NetBSD. OpenBSD and Ubuntu will probably pick it up in due course.
As for tac(1)
, here's mine (needs an actual file and here-strings):
$ cat foo.txt
Behold
the
power
of
mighty
ed(1).
$ ed -s foo.txt <<<$'g/.*/m0\n%p'
ed(1).
mighty
of
power
the
Behold
$