Bash – Parse a file forwards and backwards

By | April 15, 2015

Some people say that you never know everything, how very true that is when you are scripting in Bash Shell. A week ago I found out something I needed to do a million times before, but had always re-invented the wheel to do so….

Bash – Parse a file FORWARDS (the easy one)

cat <file> | while read LINE ; do

echo $LINE


so now…

Bash – Parse a file BACKWARDS (cat backwards = tac)

tac <file> | while read LINE ; do

echo $LINE


Wasnt hard was it, but like any question, its only easy if you know the answer !! I have made a new post for this with a more practical example/tutorial HERE

Check out -  Easy install ffmpeg on Linux - The ultimate media handling utility

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.