[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: setting env variables
From: |
Ian Mondragon |
Subject: |
Re: setting env variables |
Date: |
Mon, 29 Jan 2001 18:40:06 -0500 |
User-agent: |
Mutt/1.2.5i |
all -
thank you! everybody's input was much needed and appreciated.
helge: i was starting to do something exactly like what you recommend below...
but after the overwhelming (and well deserved, i might add :-) call to reality
that i'm an utter bonehead [i've never claimed to be a shell hacker/guru by any
stretch of the imagination...can you tell?], i came to an even greater
realization: that this whole "gshell" idea on it's *own* is fruitless. i think
a better thing to do would be to combine this idea - a *working* version <grin>
- with the TermConfig app i've almost got finished. seems like that would be
the logical thing to do in the first place.
again, thanks everybody.
-ian mondragon
===> Helge Hess <helge.hess@skyrix.com> [01/29/01 05:52]:
> Sungjin Chun wrote:
> > Setting parent shell's envronmental variable
> > is possible?
>
> Of course you can't. The approach of Ian simply won't work. BTW: you
> don't need to use putenv if you use NSTask to fork your programs. Ian's
> usage of putenv() is probably only due to the above misconception.
>
> The environment variables need to be set in the shell, not in a program
> forked by the shell.
> One workaround would be to write an ObjC program which writes
> environment variables to stdout or a temporary file and is processed by
> a small bash/tcsh script. Eg your program could emit a file containing
> this:
> ---
> export blah='10'
> export blub='20'
> ...
> ---
> which is then 'source'd by the calling shell.
>
> You could pass in $SHELL to select the proper set-environment syntax
> (export in sh, setenv in tcsh).
>
> Greetings
> Helge
> --
> SKYRIX Software AG http://www.skyrix.com/
> Join the team: http://www.skyrix.com/de/jobs/index.html
>
--
@end
Ian Mondragon - copal@dragonhelix.org
http://www.dragonhelix.org
FreeBSD - Objective-C - Python.