delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/01/02/19:11:02

Sender: rich AT phekda DOT freeserve DOT co DOT uk
Message-ID: <3E14D4D7.7847EB0C@phekda.freeserve.co.uk>
Date: Fri, 03 Jan 2003 00:09:59 +0000
From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586)
X-Accept-Language: de,fr
MIME-Version: 1.0
To: DJGPP newsgroup <djgpp AT delorie DOT com>, "Mark E." <snowball3 AT softhome DOT net>
CC: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
Subject: Re: Handling of TMPDIR, TEMP by various DJGPP programs
References: <3E14606E DOT E5B4D1A9 AT phekda DOT freeserve DOT co DOT uk> <7458-Thu02Jan2003202306+0200-eliz AT is DOT elta DOT co DOT il> <1041532689 DOT 964798 AT queeg DOT ludd DOT luth DOT se>
Reply-To: djgpp AT delorie DOT com

Martin Str|mberg wrote:
> 
> Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote:
[snip]
> : Bash _must_ have TMPDIR forward-slashed, or else lots of scripts will
> : fall apart.  I don't know about Perl, but I think you are right
> : assuming it should get the same treatment.
> 
> I've "set TMPDIR=t:/tmp" in my AUTOEXEC.BAT but still the perl snippet
> above says "t:\tmp" so there's something more going on.

Under bash? How about under DOS? I see different behaviour depending on the
shell:

C:\WINDOWS>perl -e 'print $ENV{TMPDIR}."\n";'
C:/TEMP

C:\WINDOWS>ver

Windows 98 [Version 4.10.2222]

bash-2.04$ perl -e 'print $ENV{TMPDIR}."\n";'
c:\temp
bash-2.04$ bash --version
GNU bash, version 2.04.7(1)-release (i386-pc-msdosdjgpp)
Copyright 1999 Free Software Foundation, Inc.

bash 2.05b built against DJGPP CVS seems to work OK:

bash-2.05b$ perl -e 'print $ENV{TMPDIR}."\n";'
C:/TEMP
bash-2.05b$ echo | awk '{ print ENVIRON["TMPDIR"] }'
C:/TEMP
bash-2.05b$ $SHELL --version
GNU bash, version 2.05b.0(1)-release (i686-pc-msdosdjgpp)
Copyright (C) 2002 Free Software Foundation, Inc.

(Note that this bash was spawned from a DOS prompt.)

bash 2.04 built against DJGPP CVS has the problem:

bash-2.04$ perl -e 'print $ENV{TMPDIR}."\n";'
c:\temp
bash-2.04$ echo | awk '{ print ENVIRON["TMPDIR"] }'
c:\temp
bash-2.04$ gnu/bash-2.04/bash.exe --version
GNU bash, version 2.04.7(1)-release (i686-pc-msdosdjgpp)
Copyright 1999 Free Software Foundation, Inc.

(Note that this bash was spawned from a DOS prompt. I had to #if 0/#endif out
the code in gnu/bash-2.04/lib/dos/dosexec.c, to use the code from libc.)

One thing I noticed is that bash 2.04 does not set $SHELL. If I set $SHELL to
point at the bash 2.04 executable, it does not affect the results. bash 2.05
does set $SHELL.

Looking at the sources, I see that TMPDIR is one of the variables fixed up in
2.04. In 2.05 it is not fixed up. Mark, why is this?

Regards,

-- 
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019