Computing.Net > Forums > Unix > Testing ENV variable

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Testing ENV variable

Reply to Message Icon

Name: pradeep desh
Date: February 22, 2005 at 08:06:19 Pacific
OS: sun os 5.8
CPU/Ram: 256 MB
Comment:

Hi all,
Can anybody tell me about the use of ENV variable and how to test the ENV varible using exec.
How it can be used in our profile file.

waiting for reply.



Sponsored Link
Ads by Google

Response Number 1
Name: WilliamRobertson
Date: February 26, 2005 at 11:57:39 Pacific
Reply:

From man ksh:

ENV

This variable, when the shell is invoked, is subjected to parameter expansion by the shell and the resulting value is used as a pathname of a file containing shell commands to execute in the current environment. The file need not be executable. If the expanded value of ENV is not an absolute pathname, the results are unspecified. ENV will be ignored if the user's real and effective user IDs or real and effective group IDs are different.

This variable can be used to set aliases and other items local to the invocation of a shell. The file referred to by ENV differs from $HOME/.profile in that .profile is typi- cally executed at session startup, whereas the ENV file is executed at the beginning of each shell invocation. The ENV value is interpreted in a manner similar to a dot script, in that the commands are executed in the current environment and the file needs to be readable, but not executable. However, unlike dot scripts, no PATH searching is performed. This is used as a guard against Trojan Horse security breaches.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Testing ENV variable

preserver ENV variable in perl www.computing.net/answers/unix/preserver-env-variable-in-perl/7187.html

Preserving env variable inside perl www.computing.net/answers/unix/preserving-env-variable-inside-perl/7176.html

problem in variable www.computing.net/answers/unix/problem-in-variable/5970.html