>_ IzzyLab

Topic breakdown

mv renames one file at a time and doesn't understand bulk patterns like *.txt → *.bak, so batch renaming is done with a for loop that expands a glob pattern and yields the next path on each iteration. Turning name.txt into name.bak is helped by parameter substitution of the form ${variable%suffix}: the % sign cuts the shortest matching suffix off the end, after which the new extension is appended to the remainder. Variables should be quoted in case names contain spaces.

What's checked

  1. no .txt files left
  2. every .txt became a .bak with the same content

What it looks like