Add mare ex .if condition

This commit is contained in:
2025-12-14 20:14:48 +00:00
parent 68d1d59b16
commit fe7b8c6091

View File

@@ -1,15 +1,15 @@
#!/bin/bash #!/bin/bash
##1 ##Daca numarul total de argumente are mai putin de 2 argumente:
if [ -z "$1" ]; then if [ $# -lt 2 ]; then
echo "Usage: ./script.sh $name" echo "Usage: ./script.sh <first_name> <last_name>"
exit 1 exit 1
fi fi
name="$1" first_name="$1"
last_name="$2"
echo "Hello, $name!" echo "Hello, $first_name $last_name!"
echo "Welcome to DevOps Bash scripting."