Script for looking for people of specific age and country done;

This commit is contained in:
Arkadiusz Hypki 2023-05-08 17:03:43 +02:00
parent 2f7b833d09
commit 4aae9a0f24
1 changed files with 10 additions and 1 deletions

View File

@ -11,6 +11,15 @@ do
name=`echo $line | cut -d " " -f 1`
age=`echo $line | cut -d " " -f 2`
country=`echo $line | cut -d " " -f 3`
echo "Person $name (from $country) is $age years old"
if [ $name != "#" ]
then
if [ $country = "$2" -a $age -ge $3 ]
then
echo "Person $name (from $country) is $age years old"
fi
fi
done < $1