Re: environment variable & shell
- From: Bit Twister <BitTwister@xxxxxxxxxxxxxxxx>
- Date: Sat, 25 Sep 2010 14:43:58 +0000 (UTC)
On Sat, 25 Sep 2010 20:09:21 -0700, ela wrote:
In fact I have many programs to access common data and programs. I don't
wanna change the path in every programs (more than 20) every time when I
migrate my programs to a new server and I just wanna make them point to an
environment variable so every time I just have to modify the path of that
environment variable. so what should i do then?
Pick a variable name that has the top of your application directory.
Your scripts use it for each "path" they need. Example:
export MYAPP_TOP=/somenode/somewhere/someapp
MYAPP_TOP is set system wide by the sysadmain or whoever installs your
application. That directory has your bin, etc, doc, help, data,
lib, ... sub-directories.
Now your shell scripts are in with $MYAPP_TOP/bin/ and can get the
rest of their environment with the command ". $MYAPP_TOP/etc/env.sh"
or ". $MYAPP_TOP/etc/functions.sh" or whatever.
.
- Follow-Ups:
- Re: environment variable & shell
- From: ela
- Re: environment variable & shell
- References:
- environment variable & shell
- From: ela
- Re: environment variable & shell
- From: Bit Twister
- Re: environment variable & shell
- From: ela
- environment variable & shell
- Prev by Date: Re: environment variable & shell
- Next by Date: Re: Software for online backup/versioning file system?
- Previous by thread: Re: environment variable & shell
- Next by thread: Re: environment variable & shell
- Index(es):
Relevant Pages
|