This is a discussion on $TEMP or $TMP? within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> was updating some of my scripts yesterday... noticed a lack of a variable for TEMP or TMP or tmp ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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? Ray (who likes %TEMP% in windows especially since they went to c:\documents and settings\username\blah\blah\blah\temp....) |
| |||
| -----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----- |
| |||
| Lew Pitcher wrote: > -----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). > I know I can create an envvar, I guess I was just surprised to not find it already defined. How do you know that /tmp is "required"? Not really trying to argue, but does the kernel source spell out /tmp as a requirement? Do programs just assume it's there and properly mounted? oh, and it's %systemroot% - there's no %system% var. |
| |||
| ray <nospam@example.com> wrote: > How do you know that /tmp is "required"? Not > really trying to argue, but does the kernel source spell out /tmp as a > requirement? Do programs just assume it's there and properly mounted? The POSIX standard requires that there is a /tmp directory. You may rely on the existence of that directory. Yours, Laurenz Albe |
| |||
| Laurenz Albe <albe@culturallnospam.com> wrote: >> requirement? Do programs just assume it's there and properly mounted? > > The POSIX standard requires that there is a /tmp directory. > You may rely on the existence of that directory. In multi-user level, that is. Single user there MAY not be a /tmp present cq mounted yet. -- ************************************************** ****************** ** Eef Hartman, Delft University of Technology, dept. EWI/TW ** ** e-mail: E.J.M.Hartman@math.tudelft.nl, fax: +31-15-278 7295 ** ** snail-mail: P.O. Box 5031, 2600 GA Delft, The Netherlands ** ************************************************** ****************** |
| ||||
| Laurenz Albe wrote: > ray <nospam@example.com> wrote: > >> How do you know that /tmp is "required"? Not >>really trying to argue, but does the kernel source spell out /tmp as a >>requirement? Do programs just assume it's there and properly mounted? > > > The POSIX standard requires that there is a /tmp directory. > You may rely on the existence of that directory. > > Yours, > Laurenz Albe Works for me. Thank you for clearing that up. I learn something new every day. Ray |