Re: Envr variable and Shell Variable (141 Views)
Reply
Occasional Contributor
Srinivas Manoj
Posts: 5
Registered: ‎08-19-2010
Message 1 of 4 (141 Views)

Envr variable and Shell Variable

Can anyone explain me in simple terms the difference between Environment and Shell Variables.
Acclaimed Contributor
James R. Ferguson
Posts: 21,184
Registered: ‎07-06-2000
Message 2 of 4 (141 Views)

Re: Envr variable and Shell Variable

Hi:

Environmental variables are inherited variables from a parent process. A variable that you declare (in a shell) and subsequently 'export' (or 'setenv' in a C-shell) becomes an environmental variable. As such, any child process created, inherits that variable.

Regards!

...JRF...
Frequent Advisor
raghukiran.g
Posts: 38
Registered: ‎07-30-2010
Message 3 of 4 (141 Views)

Re: Envr variable and Shell Variable

actually the environment variables determines the environment of your shell like your display console,path when you give the extrinsic commands,and all these are used for the system specific process(GLOBAL VARIABLES),

and the shell variables are just related to the shell itself which are used for the shell specific purpose(LOCAL VARIABLES)..

child shell inherits the environment variables from parent shell,if we want to inherit the shell variables also then we have to export that particular shell variable from parent shell...
Proud to be in HP IT Resource Center
Advisor
Amit Shrivastava_1
Posts: 21
Registered: ‎07-27-2010
Message 4 of 4 (141 Views)

Re: Envr variable and Shell Variable

environment variables as the name suggests , are there for the environment ie these are the variables which will be inherited by child processes , For eg if you invoke another shell by just doing ksh , the value of these variables will be inherited to the new shell

However, shell variables are local to that shell .if you open another shell these values will not get copied to that shell.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.