Implement writing the command list to a script