X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 	tests=AWL,BAYES_00,SPF_NEUTRAL
X-Spam-Check-By: sourceware.org
Message-ID: <4B151652.9080107@cornell.edu>
Date: Tue, 01 Dec 2009 08:12:50 -0500
From: Ken Brown <kbrown@cornell.edu>
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: Unset TMP/TEMP in profile? (was Re: [ANNOUNCEMENT] [1.7]   Updated:   cygwin-1.7.0-67)
References: <4B14573C.3040409@alice.it>     <a13b5a590911301753w74ccf298g669e55fc58d36c50@mail.gmail.com>     <20091201091515.GC30043@calimero.vinschen.de> <b610e770a6f8ab524e0df3c9ce625e84.squirrel@mail.morrison.mine.nu>
In-Reply-To: <b610e770a6f8ab524e0df3c9ce625e84.squirrel@mail.morrison.mine.nu>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On 12/1/2009 5:44 AM, John Morrison wrote:
> On Tue, December 1, 2009 9:15 am, Corinna Vinschen wrote:
>> I'm wondering if /etc/profile is actually the right place for unsetting
>> TMP and TEMP.  What about etc/defaults/etc/skel/.bashrc instead?  It
>> allows every user simple access to the setting of TMP and TEMP and it
>> could be seasoned with a user-visible comment.
> 
> 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

Ken

--
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

