Conditional Statement in Bash
Conditional statement :
- Conditional statement plays a vital role in programming.
- Every decision making part can be done with conditional statement.
- Conditional statement in bash is similar to python .But the coding style differ.
- Common conditional Statements are:
- if statement
- if-else statement
- if-elif-else statement
- switch cases
- These are the common conditional statement.
- Most of the popular programming language use these in the same format with slight modifications.
If else statement:
- Syntax:
- The if condition should be terminated with "fi" which is nothing but the reverse of "if".
If-elif-else statement:
No comments:
Post a Comment