User Tools

Site Tools


awk:awk_loops

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
awk:awk_loops [2020/05/06 19:54] peterawk:awk_loops [2020/07/15 09:30] (current) – external edit 127.0.0.1
Line 9: Line 9:
 ===== For loops ===== ===== For loops =====
  
-The **for** statement performs some initialization action, then it checks the condition.+**for** statement performs some initialization action, then it checks the condition.
  
 If the condition is true, it executes actions, thereafter it performs increment or decrement operation. If the condition is true, it executes actions, thereafter it performs increment or decrement operation.
Line 33: Line 33:
 ===== While Loop ===== ===== While Loop =====
  
-The while loop keeps executing the action until a particular logical condition evaluates to true.+A **while** loop keeps executing the action until a particular logical condition evaluates to true.
  
 AWK first checks the condition; if the condition is true, it executes the action. AWK first checks the condition; if the condition is true, it executes the action.
Line 57: Line 57:
 ===== Do-While Loop ===== ===== Do-While Loop =====
  
-The **do-while** loop is similar to the while loop, except that the test condition is evaluated at the end of the loop.+**do-while** loop is similar to the while loop, except that the test condition is evaluated at the end of the loop.
  
 In a do-while loop, the action statement gets executed at least once even when the condition statement evaluates to false. In a do-while loop, the action statement gets executed at least once even when the condition statement evaluates to false.
Line 79: Line 79:
 ===== Break Statement ===== ===== Break Statement =====
  
-Break is used to end the loop execution.+**Break** is used to end the loop execution.
  
 <code awk> <code awk>
Line 108: Line 108:
 ===== Continue Statement ===== ===== Continue Statement =====
  
-The **continue** statement is used inside a loop to skip to the next iteration of the loop.+**continue** statement is used inside a loop to skip to the next iteration of the loop.
  
 It is useful when you wish to skip the processing of some data inside the loop. It is useful when you wish to skip the processing of some data inside the loop.
awk/awk_loops.1588794861.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki