Wednesday, 5 October 2016

linux - How to read each line of a file 1 at a time in BASH

I need to read each line of a file in BASH one at a time and perform an operation on each line.


Here's some pseudo-code outlining what I need to have happen:


while( fileIsNotEmpty )
{
line = ReadNextLine()
SomeOperation(line)
}

How do I do this?

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...