Enviroment variables

Hello,

Where are enviroment variables (such as PATH, LIB) held? In which file? And
what are these variables?

Darius

Darius <alpha_byte@safe-mail.net> wrote:

Hello,

Where are enviroment variables (such as PATH, LIB) held? In which file? And
what are these variables?

They aren’t held in a file per se.

They are passed as part of the creation of a process from parent to
child.

Exactly where, and how, different environment variables get set
is really beyond the domain of an easy newsgroup answer.

But… if you are talking ONLY from the point of doing a login/command
shell, then the usual place to set them would be in a file in the
home directory (defined by HOME environment variable, set by the
login process, based upon the password file entry for that user)
called .profile.

-David

Please follow-up to newsgroup, rather than personal email.
David Gibbs
QNX Training Services
dagibbs@qnx.com

David Gibbs wrote:

Darius <> alpha_byte@safe-mail.net> > wrote:
Hello,

Where are enviroment variables (such as PATH, LIB) held? In which file? And
what are these variables?

They aren’t held in a file per se.

They are passed as part of the creation of a process from parent to
child.

Exactly where, and how, different environment variables get set
is really beyond the domain of an easy newsgroup answer.

But… if you are talking ONLY from the point of doing a login/command
shell, then the usual place to set them would be in a file in the
home directory (defined by HOME environment variable, set by the
login process, based upon the password file entry for that user)
called .profile.

-David

Please follow-up to newsgroup, rather than personal email.
David Gibbs
QNX Training Services
dagibbs@qnx.com

An ideal solution would be the equivalent of the Windows Registry or am I
swearing again!!!

david chivers <david@emulatorsinternational.com> wrote:

David Gibbs wrote:

Darius <> alpha_byte@safe-mail.net> > wrote:
Hello,

Where are enviroment variables (such as PATH, LIB) held? In which file? And
what are these variables?

They aren’t held in a file per se.

They are passed as part of the creation of a process from parent to
child.

Exactly where, and how, different environment variables get set
is really beyond the domain of an easy newsgroup answer.

But… if you are talking ONLY from the point of doing a login/command
shell, then the usual place to set them would be in a file in the
home directory (defined by HOME environment variable, set by the
login process, based upon the password file entry for that user)
called .profile.

-David

Please follow-up to newsgroup, rather than personal email.
David Gibbs
QNX Training Services
dagibbs@qnx.com

An ideal solution would be the equivalent of the Windows Registry or am I
swearing again!!!

In what way is the Windows Registry ideal?

As far as I can tell, it is one of the more horrific bits of
Windows to deal with, handle, modify, or debug.

There are a few system-wide variables presented through the
sysconf interface, but these are kept to a minimum.

The use of inheritted environment variables, makes them easy to
change on the fly, customize from user to user and from session
to session for a particular user. For instance, if I normally
run in Photon on my machine, I could have my EDITOR environment
variable being ped; but if I telnet in to that machine, I can
just change the EDITOR variable to vi for that telnet session,
and if I walk back to my Photon session, it won’t have changed
there, I’ll still get ped. I don’t know of a way to easily and
simply get that sort of flexibility using the Windows Registry.

-David

Please follow-up to newsgroup, rather than personal email.
David Gibbs
QNX Training Services
dagibbs@qnx.com