diff --git a/04/01.sh b/04/01.sh new file mode 100755 index 0000000..5343cfa --- /dev/null +++ b/04/01.sh @@ -0,0 +1,24 @@ +#!/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 + + if [[ ${uwu[0]} -gt ${owo[0]} ]]; then + [[ ${owo[1]} -ge ${uwu[1]} ]] && count=$((count+1)) + elif [[ ${uwu[0]} == ${owo[0]} ]]; then + [[ ${owo[1]} -ge ${uwu[1]} || ${uwu[1]} -ge ${owo[1]} ]] && count=$((count+1)) + else + [[ ${uwu[1]} -ge ${owo[1]} ]] && count=$((count+1)) + fi + +done <<< "$data" + +echo $count +