Hi Folks,
I am pretty new to
java and unix. I have the following questions:
1. we have a shell script sample.sh that sets environment variable. we always execute the script by first going to the location where the script is kept and then execute the command in following way:
. ./sample.sh
when I try to execute the same script by
./sample.sh
the environment variables are not set whereas they are properly set through . ./sample.sh
can anyone please tell me the difference why it fails to set env in second way?
2. I wish to use a java program (to be run in unix) to set the above environment variables. I am really confused about the method I should use for this
a. either call the script
b. directly set the environment variables from the file sample.sh
I fear how i can call . ./sample.sh in java.
my aplogies for the naive question!
thanks in advance,
Kunal