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
If tail -r isn't available and you don't have egrep, the following works nicely:
tail -r
egrep
tac $FILE | grep -m 1 '.'
As you can see, it's a combination of two of the previous answers.