~/machines.sh counts the errors in each shop's machine logs. It pastes the same block for the fridge, the oven and the door, and last week's fix went into two copies, not the third: east side's door is wrong.
learner@reef:~$ ./machines.sh north
== north ==
fridge errors: 1
oven errors: 0
door errors: 0Split it into functions, write the block once, and keep everything else it prints the same. You have 15 minutes. If the time runs out, you can still finish.
Objectives
- At least two functions, and
./machines.sh northprints exactly as before. - The machine block is written once.
./machines.sh north southprints as before. ./machines.sh "east side" nowherereports east side's door, writesno such shop: nowhereas an error, and ends with exit code 1.