Skip to content

Latest commit

 

History

History
11 lines (6 loc) · 231 Bytes

tac.md

File metadata and controls

11 lines (6 loc) · 231 Bytes

tac

cat reversed line-wise.

Coreutils.

[ "$(printf "a\nb\n" | tac)" = "$(printf "b\na")" ] || exit 1

Things get messy if the input does not end in newline:

[ "$(printf "a\nb" | tac)" = "$(printf "ba")" ] || exit 1