Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

setenv command

0 views
Skip to first unread message

Kannan Ekanath

unread,
Dec 18, 2003, 2:22:08 AM12/18/03
to
Hi,
Does anybody know how to write setenv commands inside some script.
actually i need to set lot of environment variables, so thought of
writing into some script. but looks like it does not pick because of the
environment...
For example

(username) home - cat myscript
setenv vara valuea
setenv varb valueb
/home/user/someexe
(username) home - ./myscript

now the someexe is not able to pick up the environment variables (since
the variables are set in different environment). does someone know any
alternative to this??
Thanks
kannan

Chris F.A. Johnson

unread,
Dec 18, 2003, 4:12:58 AM12/18/03
to

What shell? C-type shells (such as tcsh) are not recommended for
scripts, and Bourne-type shells (such as bash or ksh) do not have
a setenv command.

In a Bourne-type shell, one exports variables:

var=val
export val

In bash, this may be shortened to:

export var=val

--
Chris F.A. Johnson
=================================================================
cf...@freeshell.org http://cfaj.freeshell.org

0 new messages