Unset TMP/TEMP in profile? (was Re: [ANNOUNCEMENT] [1.7] Updated: cygwin-1.7.0-67)

Andy Koppe andy.koppe@gmail.com
Tue Dec 1 13:34:00 GMT 2009


2009/12/1 Ken Brown:
> On 12/1/2009 5:44 AM, John Morrison wrote:
>> Unsetting them in the skel .bashrc files shouldn't be a problem to do, but
>> on my system...
>>
>> $ echo $TMP
>> /cygdrive/c/DOCUME~1/morrijr/LOCALS~1/Temp
>>
>> Tue Dec 01 10:40 AM
>> $ unset TMP
>>
>> Tue Dec 01 10:40 AM
>> $ echo $TMP
>>
>>
>> Tue Dec 01 10:40 AM
>> $
>>
>> They don't get 'reset' to the windows default... but then, I've not really
>> been following this thread.  Is that what's wanted?
>
> No, they're not expected to get reset.
>
>> Also, $PATCH and $TMPDIR weren't defined on my system anyway...
>
> The discussion about "patch" referred to the program /usr/bin/patch, not to
> an environment variable.
>
> TMPDIR is apparently not defined by default in the Windows environment, so
> it will usually be undefined unless the user has defined it.  I think it
> should therefore be left alone.
>
> The proposal, then, is simply to unset TMP and TEMP in the skel .bashrc
> file.  There should be some sort of comment for the sake of users who want
> those variables to be set for whatever reason.  Here's one possibility, but
> it may be a little too verbose:
>
> # TMP and TEMP are defined in the Windows environment.  Leaving
> # them set to the default Windows temporary directory can have
> # unexpected consequences.
> unset TMP
> unset TEMP
>
> # Alternatively, set them to the Cygwin temporary directory
> # export TMP=/tmp
> # export TEMP=/tmp
>
> # Or use TMPDIR instead
> # export TMPDIR=/tmp

If the ability to get back to the Windows settings is considered
important, TMP and TEMP could be saved to other variables before
unsetting or changing them, for example:

export WTMP="$TMP"
export WTEMP="$TEMP"

Andy

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list