According to Mike Paradis:
> I'll try to explain this as best as I can. My system will not keep an environment
> variable for some reason.
>
> The 'rundig' script sets the environment which I require. That is the TMPDIR=/ var.
> In my case, I set it to 'export TMPDIR=/netserv/tmp'. Htdig uses the tmp directory
> properly but for some strange reason, it is always lost by the time htmerge is run.
>
> In other words, while the dig runs, htdig uses /netserv/tmp but the moment that
>htmerge
> runs, it uses the main dirve /tmp for some reason.
OK, I'm getting mixed messages from your e-mail, so I don't know if I
understand your question correctly. Are you running htdig and htmerge
from the same shell script, from different shell scripts, or from the
command line? If they're both run from the same shell script, and this
shell is somehow losing the value of the TMPDIR environment variable,
that is indeed strange. However, without seeing the script for myself,
I'd be at a loss as to figuring out why this might be happening.
> I am completely stumped on this one. I am running Red Hat 6.2 for the dig and am
>trying
> to tell htdig/htmerge to use /netserv/tmp as it's work directory. Since it won't, I
>have
> spent a great deal of time running digs that later htmrge cannot update properly. I
>end
> up with a small (2K) db.docs.index file which htmerge never updates and large work
>files
> that also become useless. I have also run htmerge manually while the env var was set
>and
> it worked fine during the test but I still need this to be done for the entire dig.
>
> I have searched and searched and have found many ways of setting a variable and they
>all
> work just fine. However, since I have to manually call a dig and then log off, the
>env
> var is lost when the shell exits.
>
> What I need to do is to set the variable in a manner that makes it global, system
>wide on
> boot up. I've also tried to set this in rc.local so that it would be set at boot
>time. I
> just can't seem to find a way to have the system set the following var so that it is
> there, all the time.
>
> export TMPDIR=/netserv/tmp
>
> Anyhow, sorry that this is so verbose but better explained than not :).
Well, verbose doesn't necessarily mean better explained. The last couple
paragraphs suggest a very different story than the first one. Are you
expecting a setting of TMPDIR in a shell script to persist beyond the
execution of that script? Or are you expecting a setting of TMPDIR
from the command line to persist beyond your current login session?
If so, you don't seem to understand the nature of Unix/Linux runtime
environments and their associated variables.
Environments exist on a per-process basis. That is, each an every process
has its own unique environment. Setting or changing the environment of
one process does not affect the environment of other existing processes,
as they already exist in their own environment.
However, environments are inherited by child processes, from their
parent process. So, for example, if a shell script sets an environment
variable, its child processes (i.e. to commands it runs) will inherit
them. However, your login shell, and the rest of the system, will not
be affected by this environment variable setting, as they have their
own independent environments. There is no such thing as a system-wide
environment variable setting, apart from perhaps the environment that's
inherited from the initial system process, "init". You don't set that.
It normally wouldn't make sense to.
If you want an environment variable to persist from one login to the next,
you need to put it in a file that's executed directly by your login shell
when you login. This file is called .profile, in your home directory,
for the sh, ksh or bash shell, or .login for csh or tcsh. Of course,
if your login shell is csh or tcsh, they use a different syntax, and you
need to use setenv rather than export. See the Unix/Linux documentation
for your shell for more details.
--
Gilles R. Detillieux E-mail: <[EMAIL PROTECTED]>
Spinal Cord Research Centre WWW: http://www.scrc.umanitoba.ca/~grdetil
Dept. Physiology, U. of Manitoba Phone: (204)789-3766
Winnipeg, MB R3E 3J7 (Canada) Fax: (204)789-3930
_______________________________________________
htdig-general mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/htdig-general