Day 8
This commit is contained in:
12
08/01.sh
Executable file
12
08/01.sh
Executable 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
|
||||
Reference in New Issue
Block a user