This commit is contained in:
2021-12-08 11:48:58 +01:00
parent 22fa29f09d
commit bb4cda8b02
2 changed files with 54 additions and 0 deletions

12
08/01.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
n_found=0
while read line; do
number=' '$(sed -e 's/.* | //' -e 's/ / /g' <<< $line)' '
number=$(sed -e 's/ [a-z]\{2\} / 1 /g' -e 's/ [a-z]\{3\} / 7 /g' -e 's/ [a-z]\{4\} / 4 /g' \
-e 's/ [a-z]\{7\} / 8 /g' -e 's/ [a-z]\{5\} / /g' -e 's/ [a-z]\{6\} / /g' <<< $number)
found=${number// /}
i_found=${#found}
n_found=$((n_found+i_found))
done
echo $n_found