How do I get the last non-empty line using tail under Bash shell?
tail
For example, my_file.txt looks like this:
my_file.txt
hello
Instead of tac you can use tail -r if available.
tac
tail -r
tail -r | grep -m 1 '.'