From fe7b8c609123b4a97d3c1bee6c9a93714b776949 Mon Sep 17 00:00:00 2001 From: Liana Date: Sun, 14 Dec 2025 20:14:48 +0000 Subject: [PATCH] Add mare ex .if condition --- script.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/script.sh b/script.sh index eaef600..a3f4edc 100755 --- a/script.sh +++ b/script.sh @@ -1,15 +1,15 @@ #!/bin/bash - ##1 -if [ -z "$1" ]; then - echo "Usage: ./script.sh $name" - exit 1 +##Daca numarul total de argumente are mai putin de 2 argumente: +if [ $# -lt 2 ]; then + echo "Usage: ./script.sh " + exit 1 fi -name="$1" +first_name="$1" +last_name="$2" -echo "Hello, $name!" -echo "Welcome to DevOps Bash scripting." +echo "Hello, $first_name $last_name!"