I am looping through a file in bash and performing some operations on it. Here is the code.
cat test.dat -
One
Two
Three
Case 1: With if inside while loop
Output:
One
file found
------------------
isn't it supposed to print following output !!!
one
file found
two
file found
three
file found
four
file found
Case 2: I comment if condition inside loop
Output:
one
two
three
four
Can come one explain why is this happening ? Why is if breaking the loop.
-Steve