>_ IzzyLab

Topic breakdown

Besides iterating over a ready-made list, for in bash can work C-style: the triple "initialization; condition; step" in double parentheses (( ... )) enables arithmetic mode, home to comparisons and operators like i--. Such a loop naturally runs in reverse too, when the continuation condition is "while the counter hasn't dropped below the lower bound". A separate topic: the code runs as a file, so it needs a shebang and the executable bit (chmod +x), and the result is placed in a file with the > redirection.

What's checked

  1. the countdown runs from 5 to 1
  2. the output has 5 lines

What it looks like