backup;
This commit is contained in:
parent
408500556f
commit
2f7b833d09
@ -1,6 +1,16 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# iterating line-by-line over the input file
|
# iterating line-by-line over the input file
|
||||||
numOfPeople=`cat $1 | grep 'Poland' | wc -l`
|
#numOfPeople=`cat $1 | grep $2 | wc -l`
|
||||||
|
#echo "Num. of people from $2 is $numOfPeople"
|
||||||
|
|
||||||
echo "Num. of people from Poland is $numOfPeople"
|
# iterating line-by-line
|
||||||
|
while read line
|
||||||
|
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"
|
||||||
|
|
||||||
|
done < $1
|
||||||
|
Loading…
Reference in New Issue
Block a user