LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Setenv (http://www.linuxquestions.org/questions/linux-software-2/setenv-38946/)

IBP 12-20-2002 02:26 AM

Setenv
 
How do you do a setenv in redhat 8.0 ? - setenv doesn't appear to be a command which can be called in the same way as on unix.

Thanks

aizkorri 12-20-2002 04:11 AM

It depends on the shell you are using. If it is csh it works, but, for example, you have to use export in case you use bash.
type csh and the youŽll be able to use setenv.

Hope this helps.

IBP 12-20-2002 05:10 AM

Thanks for that, what is the difference between bash and csh, and why are such useful things as setenv not implemented in bash?

Software I am trying to use has a script run from <cshrc> in the form 'alias source /home/x/bin/setupprog' (I am just trying to run it in bashrc) that sets global variables using setenv. Since setenv doesn't work in bash can I just put the line '#! /bin/csh' at the start of the script (which is then called as an alias) ?

Cheers

stickman 12-20-2002 09:05 AM

Quote:

Originally posted by IBP
Thanks for that, what is the difference between bash and csh, and why are such useful things as setenv not implemented in bash?

Bash and csh have two different syntax structures. Both have similar functionality, but do things slightly differently. For example:
in csh: setenv VAR value
in bash: export VAR=value


All times are GMT -5. The time now is 10:59 PM.