Open main menu

CDOT Wiki β

Changes

Tutorial12: Shell Scripting - Part 2

1 byte removed, 07:54, 5 September 2020
Additional Logic Statements
[[Image:if-else.png|thumb|right|300px|Example of how an '''if-else''' statement works.]]'''if-else Statements'''
Unlike using only an if statement, an if-else statement provides take '''two different sets of actions to taken ''' based on the results of the test condition.<br><br>'''How it Works:'''<br><br>When 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 the the Linux Commands between<br>the '''else''' and '''fi''' statements are executed.
'''Example:'''
13,420
edits