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
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.
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.
Summary: Hello Gurus, I have a .sh file which sets all the ENV variable , I am running this .sh script from my perl programm but once the command returns all the ENV variables set by .sh gets lost , how can i ...
Summary: Hi, I have shell script test.sh which calls test.pl and i have test.sh running from crontab - now i am finding test.pl is loosing all the environment variable. I am trying to preserve environmen...
Summary: The ${var#pat} and ${var%pat} constructs do not recognize begin-of-line and end-of-line anchors because their logic is already targeted to either the front or the end of the variable with # or %. If ^...