What is environmental? How to add environmental variables in
run level 3 & how to edit?



What is environmental? How to add environmental variables in run level 3 & how to edit?..

Answer / neeraj k. s.

What is Environment variable?
- Environment variables are a set of dynamic named values
that can affect the way running processes will behave on a
computer.

In all Unix and Unix-like systems, each process has its own
private set of environment variables. By default, when a
process is created it inherits a duplicate environment of
its parent process, except for explicit changes made by the
parent when it creates the child. At API level, these
changes must be done between fork and exec. Alternatively,
from shells such as bash, you can change environment
variables for a particular command invocation by indirectly
invoking it via env or using the ENVIRONMENT_VARIABLE=VALUE
<command> notation. All Unix operating system flavors as
well as DOS and Microsoft Windows have environment
variables; however, they do not all use the same variable
names. Running programs can access the values of
environment variables for configuration purposes. Examples
of environment variables include:

PATH - lists directories the shell searches, for the
commands the user may type without having to provide the
full path.
HOME (Unix-like) and userprofile (Microsoft Windows) -
indicate where a user's home directory is located in the
file system.
TERM (Unix-like) - specifies the type of computer terminal
or terminal emulator being used (e.g., vt100 or dumb).
PS1 (Unix-like) - specifies how the prompt is displayed in
the Bourne shell and variants.
MAIL (Unix-like) - used to indicate where a user's mail is
to be found.
Shell scripts and batch files use environment variables to
store temporary values for reference later in the script,
and also to communicate data and preferences to child
processes.

In Unix, an environment variable that is changed in a
script or compiled program will only affect that process
and possibly child processes. The parent process and any
unrelated processes will not be affected. In DOS changing a
variable's value (or removing it) inside a BATCH file will
change the variable for the duration of command.com's
existence.

In Unix, the environment variables are normally initialized
during system startup by the system init scripts, and hence
inherited by all other processes in the system. Users can,
and often do, augment them in the profile script for the
shell they are using. In Microsoft Windows, environment
variables defaults are stored in the windows registry or
set in autoexec.bat.



How to add Environment variables in run level 3 & how to
edit?

Is This Answer Correct ?    3 Yes 2 No

Post New Answer

More Solaris Commands Interview Questions

How will you check the process for particular user

2 Answers  


As a user how he can change is passwd with root privilege.

2 Answers  


what is use of default users in solaris especilly nobady,noacess and nobady4

2 Answers  


In a two node cluster how can you bring the one of the node in maintenance mode.

2 Answers   ITC Infotech,


In which file port No’s are defined

3 Answers  






How would you truncate a log file that is growing too large if you don't have space to compress it or to move it somewhere else? How would you do it?

3 Answers  


How to check the sleeping process in Solaris.

10 Answers   Chase, JPMorgan Chase,


How to add a tape deck on Sun Solaris version 10

2 Answers  


How to Create a snapshot mirror

2 Answers  


tell me the steps to configure the vg

2 Answers   Wipro,


How to remove the volume

1 Answers  


If a User Account is locked,which file you need to check and how do you get to know at what time it has been locked.

4 Answers   CTS,


Categories
  • Solaris Commands Interview Questions Solaris Commands (360)
  • Solaris Threads Interview Questions Solaris Threads (9)
  • Solaris IPC Interview Questions Solaris IPC (30)
  • Solaris Socket Programming Interview Questions Solaris Socket Programming (3)
  • Solaris System Calls Interview Questions Solaris System Calls (25)
  • Solaris General Interview Questions Solaris General (170)
  • Solaris AllOther Interview Questions Solaris AllOther (297)