mooc/filesystem/home/carole/A44/dostat-etu.sh

29 lines
618 B
Bash
Raw Normal View History

2023-01-31 08:45:52 +04:00
#!/bin/bash
# number of arguments must be 3
...
# $2 positive integer and <= 100 ?
...
# $3 file readable ?
...
shopt -s nocasematch
nday=1
totalcases=0
#=======================
echo "# nday cases totalcases"
# format : dateRep day month year cases deaths countriesAndTerritories geoId countryCode pop
# read one line and split it until End of File
while ...
do
# continue if country doesn't match $1
...
# Filtering the noise
...
# break if nday > $2
...
((totalcases=totalcases+cases))
echo $nday $cases $totalcases
# increasing nday
...
done ... # read from data file
exit 0