swcarpentry/bc — pull request #469 by bct737 (2014-04-28 20:41:13+00:00)
Title: Adding a bit more on ${var} in novice/shell/04-loop

For Teaching round 8.5, this pull request adds some simple uses of parameter expansion to the lesson novice/shell/04-loop.

After starting the lesson material I discovered that there is some discussion of parameter expansion in the old shell lessons (lessons/swc-shell/tutorial.html). I'm guessing this was dropped based on teaching experience, which made me rethink what I was working on. The old lesson materials explicitly refer to parameter expansion and tried to introduce find/replace:
```
mv $filename ${filename/.dat/-original.dat/}
```
which replaces the longest string match. So I completely avoided the probably confusing "parameter expansion," and introduced text removal and separating variable names and text, which are a bit simpler and fit most use cases. E.g.:
```
mv $filename ${filename#original-}
mv $filename ${filename%.dat}
mv $filename ${filename}backup
```