This is UNIX.

Use LOGNAME not USER, set TMPDIR not TEMP.