3 filename=${1:-input.txt}
9 while read -u 3 mass; do
10 fuel=$((($mass / 3) - 2))
11 fuel_total=$((fuel_total+$fuel))
12 fuel_and_extra=$((fuel_and_extra+$fuel))
13 extra_fuel=$((($fuel / 3) - 2))
14 while [ $extra_fuel -gt 0 ]; do
15 fuel_and_extra=$((fuel_and_extra+$extra_fuel))
16 extra_fuel=$((($extra_fuel / 3) - 2))