Changes

Jump to: navigation, search

Tutorial12: Shell Scripting - Part 2

229 bytes added, 09:06, 5 September 2020
Additional Logic Statements
[[Image:if-elif-else.png|thumb|right|300px|Example of how an '''if-elif-else''' statement works.]]'''if-elif-else Statements'''
The '''elif''' statement can be used to perform additional conditional tests of the previous test condition tests '''FALSE'''. This statement is used to make your logic control-flow statement to be more adaptable.<br><br>''How it Works:''<br>If the test condition returns a '''TRUE ''' value, then the Linux Commands between<br>'''then ''' and '''else ''' statements are executed.<br><br>If the test returns a '''FALSE ''' value, then '''a new condition is tested''',<br>and action is taken if the result is '''TRUE ''', then the Linux Commands between<br>'''then''' and '''else''' statements are executed. '''Additional elif statements''' can be used if additional conditional testing is required . Eventually, an action will be taken<br>when the final test condition is '''FALSE'''.<br><br>
''Example:''
13,420
edits

Navigation menu