more portable temp file generation code in launch.sh