In the previous article entitled “Basic Linux Shell Scripting Language : Introduction to ‘For’ Loops“, we have observed how a loop works. Loop is nothing but a control flow statement which executes a block of commands repeatedly till certain condition stays true, once the condition becomes false, the loop is terminated.
In this article, I will explain Basic syntax of ‘While’ loop along with some examples of ‘While’ loop usage. If you are new to Shell Scripting, I recommend that, you should read my article – Getting Started – Linux Shell Scripting Language.
One of the things we found interesting in this article is that it shows how to use an infinite ‘while’ loop that can only be broken out of by some specific event or condition. Very basic stuff, but something that can come in quite handy in certain situations.
Full article here:
Basic Linux Shell Scripting Language : ‘While’ Loops (Your Own Linux..!)