Add another ex .if condition

This commit is contained in:
2025-12-14 20:16:53 +00:00
parent fe7b8c6091
commit 3ff5d29cde

View File

@@ -1,15 +1,12 @@
#!/bin/bash
##Daca numarul total de argumente are mai putin de 2 argumente:
if [ $# -lt 2 ]; then
echo "Usage: ./script.sh <first_name> <last_name>"
if [ $# -eq 0 ]; then
echo "Usage: ./script.sh <names...>"
exit 1
fi
first_name="$1"
last_name="$2"
echo "Hello, $first_name $last_name!"
echo "Hello, all of you: $@"