Tuesday, August 30, 2016

Linux Shell Script Bash Read line by line in While Loop and Print Even lines


What the code does:

It reads from the given file line by line using while loop. Next it check if the line number is even or, odd using if condition and prints the even lines.

Sample Input File:

save it as FaxNumbers.txt

Code to Print Even Lines:

Save it as "EvenLinePrinter.sh".

Run The Code:

bash EvenLinePrinter.sh

No comments: