Change to use a environment variable rather

This is much better than a temp file as it doesn't leak.