Files
Bash_Scripts/forFile.sh
2025-12-14 20:34:11 +00:00

20 lines
360 B
Bash

#!/bin/bash
# Verificăm dacă există cel puțin un argument
if [ $# -lt 1 ]; then
echo "Usage: ./script.sh <name1> [name2 ... nameN]"
exit 1
fi
# Loop prin toate argumentele folosind $@
for name in "$@"; do
if [ "$name" == "Liana" ]; then
echo "Hello, $name! You are awesome!"
else
echo "Hello, $name!"
fi
done
exit 0