Updating script to write commands/vars to a file, instead of naively trying to run/set them itself