From 5e9179d9ffd8c075df7376d8c010f3bfc55e83b6 Mon Sep 17 00:00:00 2001 From: zleyyij Date: Thu, 30 May 2024 18:09:46 -0600 Subject: [PATCH] vault backup: 2024-05-30 18:09:46 --- IT/Scripting.md | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 | | ----------------- | ---------------------------------------------------------------------------------------------- |