13,420
edits
Changes
→Using Control Flow Statements in Shell Scripts
'''Logic Statements'''
A '''logic statement ''' is used to determine which Linux commands to be executed based<br>on the result of a condition (i.e. TRUE (zero value) or FALSE (non-zero value)).
<table align="right"><tr valign="top"><td>[[Image:logic-1.png|thumb|right|250px|Example of using the '''if''' logic control-flow statement.]]</td><td>[[Image:loop-1.png|thumb|right|250px|Example of using the '''for''' looping control-flow statement.]]</td></table>
Refer to the diagram relating to logic statements on the right side for an example.
'''Looping Loop Statements'''
A '''loop statement ''' is a series of steps or sequence of statements executed repeatedly zero or more times satisfying the given condition is satisfied. Reference<br>Reference: https://www.chegg.com/homework-help/definitions/loop-statement-3
There are several loops, but we will look at the for loop using a list.