system variables howto do this

system variables howto do this

Post by vincen » Thu, 07 Dec 2000 05:12:29



can somebody tell me how to export a variable to the normal system
envirement.
i made a script and it export it's variable to  a enviroment but that
envirement exists only when the script is running
iwant the variable been set in the system enviroment so i can use the
variable also  when the script is not running.

can somebody tell me how to do this..

thanx in advance

vincent

 
 
 

system variables howto do this

Post by The.Central.Scrutinizer.wakaw.. » Thu, 07 Dec 2000 06:34:23



>can somebody tell me how to export a variable to the normal system
>envirement.
>i made a script and it export it's variable to  a enviroment but that
>envirement exists only when the script is running
>iwant the variable been set in the system enviroment so i can use the
>variable also  when the script is not running.

>can somebody tell me how to do this..

source the script.

bash> . script_name
or
csh>: source script_name

Otherwise, the script is running in a subprocess and won't affect the parent
process.

--

Use remove wakawaka and invalid to e-mail me.  You can thank spammers for this
inconvenience.

I didn't do it!  Nobody saw anything!  You can't prove anything! -- bart

 
 
 

system variables howto do this

Post by DPac » Sat, 09 Dec 2000 10:33:21



> can somebody tell me how to export a variable to the normal system
> envirement.
> i made a script and it export it's variable to  a enviroment but that
> envirement exists only when the script is running
> iwant the variable been set in the system enviroment so i can use the
> variable also  when the script is not running.

> can somebody tell me how to do this..

> thanx in advance

> vincent

You can insert the commands in one of the /etc/rc.d/...
files (my system has /etc/rc.d/rc.local which I modify).
You can also insert the commands in /etc/profile
where the command is like this:  
MYVARIABLE="HI THERE";export MYVARIABLE

You can also insert the command in the /home/username/.profile
or /home/username/.bashrc
of each user. But /etc/profile is more universal.

--
David Pace - Free commodity/stock graphing software
and Linux links at http://www.daveware.com

 
 
 

1. c shell script; Howto use environement variables to build environment variables and take their value

In a script I wish to specify two environment variables like this;

setenv FOO bee
setenv ${FOO}_ROOT /home/bee

This is ok and will set "FOO=bee" and "bee_ROOT=/home/bee".

Now I wan't to build the "bee_ROOT" variable using "FOO" and use the
value in a expression, i.e. something like this;

source ${${FOO}_ROOT}/.cshrc

This will not execute. The error is "Variable syntax". It seems that
the shell cannot figure to evaluate the inner ecpression first and
then the outer. I have tried different combination of forcing
evaluation with '' and assigning to variable first etc, but with
little luck.

Any idea/explanation why this is not possible/what I can do instead?

Cheers,
Gert.

2. Driver for the Aironet 655 wireless ethernet card

3. copying files from unix to dos system in dos readable format

4. authorization inside the LAN takes a - l o n g - time

5. Setting variables in a variable array of null variables

6. classpath not set

7. Can msdos file system handle double space DOS file system ?

8. Replacing IPCHAINS Rules

9. howto set environment variables for apps under KDE?

10. Howto redirect the output of "time" into a variable?

11. Howto capture free disk space to a variable

12. howto set $socks env variable

13. howto set variable in shell script for exit status?