Working on a Unix system, I just needed to reverse the contents of a file, and thought I'd show how I ended up doing it.
My file-reversal needs
For my situation I needed to (a) get 10 lines from the end of a file, (b) reverse those ten lines, and (c) save them to another file. If my Unix system supported the
-r option of the
tail command this would have been a no-brainer, but it didn't, so I had to work a little harder.