テキストを逆順で読み込みたい
解決
tac
を使用する
$ printf "1\n2\n3\n" | tac
3
2
1
shell - How can I reverse the order of lines in a file? - Stack Overflow
`sort -r` だと値の降順なので違う。`tail -r` はBSDでのみ有効。
tac
を使用する
$ printf "1\n2\n3\n" | tac
3
2
1
shell - How can I reverse the order of lines in a file? - Stack Overflow
`sort -r` だと値の降順なので違う。`tail -r` はBSDでのみ有効。