diff --git a/IT/Scripting.md b/IT/Scripting.md index f013f45..45634fe 100644 --- a/IT/Scripting.md +++ b/IT/Scripting.md @@ -35,6 +35,16 @@ if somecommand; then fi ``` Note that the if statement is terminated by `fi`. This is fairly standard throughout bash scripting, where the blocks are closed with the reverse text used to open them. + +You can also make use of `else` for more complex conditional logic: +``` +if somecommand; then + # If the command succeed +else + echo root is missing from the password file +fi +``` + ## Commands | Command | Description | | ----------------- | ---------------------------------------------------------------------------------------------- |