For cross OS (i.e. OSX, Linux) solution that may use tac
inside a shell script use homebrew as others have mentioned above, then just alias tac like so:
Install lib
For MacOS
brew install coreutils
For linux debian
sudo apt-get updatesudo apt-get install coreutils
Then add alias
echo "alias tac='gtac'">> ~/.bash_aliases (or wherever you load aliases)source ~/.bash_aliasestac myfile.txt