docs: function iterator(params, cmd, p)
  {
    var value = params[p];
  
    // shortcut
    if (!cmd) return cmd;
  
    // fold booleans into strings accepted by shell
    if (typeof value == 'boolean')
    {
      value = value ? '1' : '';
    }
  
    if (value !== null && ['undefined', 'string', 'number'].indexOf(typeof value) == -1)
    {
      // empty out cmd to signal the error
      return '';
    }
  
    // use empty string for `undefined`
    return cmd.replace(new RegExp('\\$\\{' + p + '\\}', 'g'), (value !== undefined && value !== null) ? value : '');
  }