meow
Dominique Liberda 2022-12-09 12:39:36 +01:00
parent 3a7d07f766
commit 5c8c36fc99
1 changed files with 27 additions and 0 deletions

27
04/02.sh Executable file
View File

@ -0,0 +1,27 @@
#!/bin/bash
# Paula fronting, so we're gonna do things a lil' differently
data="$(cat /tmp/04)"
count=0
while read line; do
IFS=, meow=($line)
IFS=- uwu=(${meow[0]})
IFS=- owo=(${meow[1]})
unset IFS
# could have been nicer but idc *shrug*
if [[ ${uwu[0]} == ${owo[0]} || ${uwu[1]} == ${owo[0]} || ${owo[1]} == ${uwu[0]} || ${owo[1]} == ${uwu[1]} ]]; then
count=$((count+1))
elif [[ ${uwu[0]} -lt ${owo[0]} && ${uwu[1]} -gt ${owo[0]} ]]; then
count=$((count+1))
elif [[ ${owo[0]} -lt ${uwu[0]} && ${owo[1]} -gt ${uwu[0]} ]]; then
count=$((count+1))
else
echo $line
fi
done <<< "$data"
echo $count