Re: environment variables



Hmmmm

However environment variables are inherted, you can't push them up the
process tree.  So calling setenv will only affect processes you create.

this is so true but;

when I execute the script:

#!/bin/bash
CVSROOT=:pserver:user server    
cvs co
make bla bla
==========================
than for the scope of that script
the CVSROOT environment variable is set

#!/bin/bash
export CVSROOT=:pserver:user server    
cvs co
make bla bla
==========================

on the other hand...

no way to implement something like `export' ?

just a speculation

Cheers,
                -TristanBrett Nash wrote:

How do I set environment variables from within a gtk application?
Assume that I want to to be able to set EDITOR to vi/emacs from within
my gtk app and then I want any new terminal / application opened in the
window manager to have the same value for EDITOR until I close my window
manager to end my session.

Is it possible? and is it window manager specific?

To set an environment variable you use setenv(3) or putenv(3).
[putenv(3) is more portable, setenv is a nicer interface].

However environment variables are inherted, you can't push them up the
 process tree.  So calling setenv will only affect processes you create.
 
 To do what you want to do you will need to work out if your window
 manager has a method of changing its enviromnent variables to pass on
to
 any children.
 
         Regards,
         nash
 
 --
 Brett Nash <nash nash nu>
 Sometimes it's better to light a flamethrower than curse the darkness.
 _______________________________________________
 gtk-app-devel-list mailing list
 gtk-app-devel-list gnome org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




Brett Nash wrote:

How do I set environment variables from within a gtk application?
Assume that I want to to be able to set EDITOR to vi/emacs from within
my gtk app and then I want any new terminal / application opened in the
window manager to have the same value for EDITOR until I close my window
manager to end my session.

Is it possible? and is it window manager specific?

To set an environment variable you use setenv(3) or putenv(3).
[putenv(3) is more portable, setenv is a nicer interface].

However environment variables are inherted, you can't push them up the
process tree.  So calling setenv will only affect processes you create.

To do what you want to do you will need to work out if your window
manager has a method of changing its enviromnent variables to pass on to
any children.

        Regards,
        nash

--
Brett Nash <nash nash nu>
Sometimes it's better to light a flamethrower than curse the darkness.
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



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