Re: How to set ENV Variables



Hey Trever,

environmental variables are part of the "environment" of the process
when a process is run. To set them, you can use the command line. The
actual sematics depends on the shell you are running.

type the following at the prompt

echo $SHELL

this should respond with the name of the shell that is currently
running. (probably /bin/bash). There are two types of shells (broadly
speaking) sh and derivatives like bash or csh (c-shell) and derivatives.

<explanation>
SHELL is a variable which has been set for you. echo is a program which
just spews stuff back at you e.g.

prompt> echo hi this is me
hi this is me
prompt>

and the $ sign indicates that the value of the keyword should take the
keyword's place. try this:

set myname=trever
echo $trever

</explanation>

okay so now we know your shell. If it wasn't bash above, I'll show how
to do the same thing with csh:

in bash:
export GNUMERIC_ENABLE_XL_OVERWRITE
gnumeric &

in csh/tcsh and others:
setenv GNUMERIC_ENABLE_XL_OVERWRITE
gnumeric &

note that in this case we don't need to set the variable to be equal to
anything. All that matters is that it exists. 

If you want to see everything that's out there try:

in bash:

set
export

this spews all the variables that have been set or exported.

in tcsh:

set
setenv.


cheers,
adrian







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]