Thread: $TEMP or $TMP?
View Single Post

   
  #2 (permalink)  
Old 02-20-2008, 07:28 AM
Lew Pitcher
 
Posts: n/a
Default Re: $TEMP or $TMP?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

ray wrote:
> was updating some of my scripts yesterday... noticed a lack of a
> variable for TEMP or TMP or tmp or temp... I know I can use /tmp/ but in
> windows I've gotten used to using %temp% being "just there" as an
> envvar... what do you guys do? Assume /tmp/ is there? create a ~/tmp/
> as needed?


Well, first of all, /tmp is /required/ to be there. It's job as a
directory is to be the host to temporary files from any user process.
/tmp exists, or your system is as broken as WinXP without a %SYSTEM%
directory. The tools and functions that manipulate temporary files do so
in /tmp (but can be overridden to do so in some other directory).

Secondly, while the environment variable $TMP or $TEMP isn't standard,
there's nothing stopping you from setting up one:
echo 'export TMP=/tmp' >>/etc/profile
echo 'export TEMP=/tmp' >>/etc/profile
or
echo 'export TMP=/tmp' >>~/.profile
echo 'export TEMP=/tmp' >>~/.profile

HTH
- --

Lew Pitcher, IT Specialist, Enterprise Data Systems
Enterprise Technology Solutions, TD Bank Financial Group

(Opinions expressed here are my own, not my employer's)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)

iD8DBQFCVCXZagVFX4UWr64RAvGuAJsEl8Xw+UetGS15XxBsi8 vDyVa7bACbBR3l
Uv2xP22ahmaqo4uIO388ghA=
=KCCM
-----END PGP SIGNATURE-----
Reply With Quote