Handle ruby string substitution in tool executable

We don't attempt to substitute ${#} etc, as this data is probably not known
at this point. At any rate, it's the wrong bit of code.

We have to substitute before validation, otherwise that fails. Most of the
other substitution happens after validation.

Reference #7