code: def shell_expand_to_popen(template, values):
    
    return [expand_variables(item, values) for item in shlex.split(template)]
docs: Expand a template like "cp $SOURCE $TARGET/blah" into a list of popen arguments.