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
You can use Awk:
awk '/./{line=$0} END{print line}' my_file.txt
This solution has the advantage of using just one tool.