How to declare a variable which can be accessed globally

Hi

I've few shell scripts which are responsible for triggering the continuous builds for a specific module. Each shell script is for a Module. Shell script has some module specific settings in the beginning and then it triggers the builds (which are nothing but some combination of Java programs for different tests) and after this we see the test results in a report.

Here is my requirement. I need a way where my shell scripts and Java programs can access a variable which has the contant value. For e.g. Shell Script 1 has a variable called MODULE which is set to "MODULE_NAME", So, I should be able to access this variable in Java Program also.

Is it possible to accomplish this without writing to the files? Something like System Enviroment Vairables???? Please help.

Thanks

In a sh script:

export MODULE

Any processes which are started after the export will have MODULE in their environment (including Java virtual machines). If you need help with accessing the environment from within a Java application, perhaps this tutorial will be of help: Environment Variables (The Java� Tutorials > Essential Classes > The Platform Environment)

Regards,
Alister

Hi,

Thanks for the suggestion. It worked i.e the export variable value is being accessed by a Java Program.

Now, I need to tell you the actual scenario of mine. As said, script will trigger the continuous build. As long as my CB runs in the same machine, I don't have any issues. To improve the speed, CB are triggered from Shell script so that those will be run in multiple remote systems (i.e. The tests are devided between the systems for the quick test results). Now, Is there at all a solution to pass some variable from Shell script which can be access by a Java Program which is running in a different system?

I'm sorry if I've confused you.

Thanks