Monday, May 24, 2010

How can I set environment values to shell in unix from the program I run?

How can I set environment values to shell in Unix from the program itself. So that the customers need not set any values by them and prevent any confusion at customer end.The value must be set each time I execute it. How can I do it...can some one help me regarding it...?

How can I set environment values to shell in unix from the program I run?
Im not sure that you mean setting them for the entire system, or for one program.





If you look in the /etc/ directory there are setup files for each shell. Such as csh.cshrc or bash.bashrc (they might not be named that). Those files set the system wide variables for anyone entering that shell. You can also see that they use the "set" command to do that so if you are talking about setting a variable for a particular program then thats how you would do that also.
Reply:You can store the values in a file and read the file each time the program runs.


No comments:

Post a Comment