Re: environment variable & shell



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.

.



Relevant Pages

  • Re: environment variable & shell
    ... wanna change the path in every programs every time when I ... and then I can put all the perls, shell scripts, java classes there, e.g. ... Now the advantage is, whenever I migrate all the stuff to another server, I ...
    (comp.os.linux.misc)
  • Re: Changing Server Name
    ... I m assuming you wanna change name of Domain controller. ... What is the role of the server, ... > A FQDN (DNS name) is build like: ...
    (microsoft.public.win2000.advanced_server)
  • Re: change server for users
    ... On Feb 1, 5:32 pm, Christoffer ... I gonna move all my printers to a new server (the printer has the same name ... and share on the new server) now i wanna change my users printers to the ... of printer requires just to change path in printer settings for user ...
    (microsoft.public.win2000.printing)
  • Re: Site URL and QuickLaunch bar
    ... What part of site URL you wanna change (server part or relative site path)? ...
    (microsoft.public.sharepoint.windowsservices)