private void copyScript(ResourceFile sourceScript, ResourceFile destinationScript)
			throws IOException {
		String oldClassName = GhidraScriptUtil.getBaseName(sourceScript);
		String newClassName = GhidraScriptUtil.getBaseName(destinationScript);

		ResourceFile parentFile = sourceScript.getParentFile();
		ResourceFile temp = new ResourceFile(parentFile, "ghidraScript.tmp");
		try (PrintWriter writer = new PrintWriter(temp.getOutputStream())) {
			try (BufferedReader reader =
				new BufferedReader(new InputStreamReader(sourceScript.getInputStream()))) {
				while (true) {
					String line = reader.readLine();
					if (line == null) {
						break;
					}
					writer.println(line.replaceAll(oldClassName, newClassName));
				}
			}
		}
		FileUtilities.copyFile(temp, destinationScript, TaskMonitor.DUMMY);
		temp.delete();
	}
Copy a script, renaming references to the class name.

@param sourceScript source script
@param destinationScript destination script
@throws IOException if we fail to create temp, write contents, copy, or delete temp
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/script/GhidraScriptComponentProvider.java