Tuesday, August 30, 2016
Linux Shell Script Bash Read line by line in While Loop and Print Even lines
August 30, 2016
bash
,
code
,
example
,
linux
,
read and print even lines
,
shell script
,
tutorial
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.txtCode to Print Even Lines:
Save it as "EvenLinePrinter.sh".Run The Code:
bash EvenLinePrinter.sh
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment