From 08eba2eccc45dc4563866ba41d9ce7eba7e33371 Mon Sep 17 00:00:00 2001 From: Liana Date: Sun, 14 Dec 2025 19:49:15 +0000 Subject: [PATCH] Add if/else conditions --- script.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/script.sh b/script.sh index 8d05b68..46e5aef 100755 --- a/script.sh +++ b/script.sh @@ -1,5 +1,40 @@ #!/bin/bash + ##1 +if [ -z "$1" ]; then + echo "Usage: ./script.sh " + exit 1 +fi + +name="$1" + +echo "Hello, $name!" +echo "Welcome to DevOps Bash scripting." + + +##2 + +if [-z "$1"]; then +echo "Usage: ./script.sh " +exit 1 +fi + +name="$1" + +if ["$name == "Liana"]; then + +echo "Hello $name! You ar awesome!" +else +echo "Hello, $name!" +fi +exit 0 + + + + + + + name="Liana" course="DevOps Bash"