[plug] Where to set an environment variable in CentOS?
Fred Janon
fjanon at yahoo.com
Mon Oct 4 14:52:31 WST 2010
Thanks Peter for the answer and the link. That helps.
Fred
--- On Sun, 10/3/10, Peter Sutter <sutterp at sopac.com.au> wrote:
From: Peter Sutter <sutterp at sopac.com.au>
Subject: Re: [plug] Where to set an environment variable in CentOS?
To: plug at plug.org.au
Date: Sunday, October 3, 2010, 10:53 PM
Fred Janon wrote:
> I installed Tomcat6 on a CentOS distrib and I need to set an environment variable as indicated here in a user's post:
>
> ------------------
> Add the $CATALINA_HOME environment variable to your PATH.
> # vi /etc/profile
> CATALINA_HOME=/usr/local/jakarta-tomcat-5.0.19
> export CATALINA_HOME
> ------------------
> I checked the /etc/profile file and it doesn't seem to be the best place to add it.
>
> What would be the best directory/file to actually set the variable so it is set globally when the system boots?
>
> Thanks
>
> Fred
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> PLUG discussion list: plug at plug.org.au
> http://www.plug.org.au/mailman/listinfo/plug
> Committee e-mail: committee at plug.linux.org.au
>
When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.
When an interactive shell that is not a login shell is started, bash reads and executes commands from ~/.bashrc, if that file <http://www.linuxquestions.org/questions/#> exists.
Peter
_______________________________________________
PLUG discussion list: plug at plug.org.au
http://www.plug.org.au/mailman/listinfo/plug
Committee e-mail: committee at plug.linux.org.au
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plug.org.au/pipermail/plug/attachments/20101004/760b28f7/attachment.html>
More information about the plug
mailing list