Hello everyone! Welcome to the third chapter of Linux Shell Scripting. In this chapter, we will see the else if condition (elif) which is the extension of if else condition. When we need to take control of more conditions, we would expand "if else" condition by using "else if" condition. While using else if condition, we can use as many "elif" we need and "else" condition at the end is optional.
To make scripting simpler and more readable, bash shell scripting also provides another tool called "case statement". If you are familiar with other programming languages, you can think of "case statement" as equivalent of "switch" but unlike switch, case statement doesn't look for another case to match once it finds the matching pattern and executes the condition. And when the command is executed, case returns the status code of that command and exit from the case.
If you want to see where and how can we use elif and case statements, please watch the entire video. And if you have any comments or suggestion, please let me know.
#ShellScripting #elif #case_statement
![](https://s2.save4k.ru/pic/fw5kp4bfg38/maxresdefault.jpg)