Request for help - can variable values be passed to an Activity ?

Mikus Grinbergs mikus at
Wed Sep 2 09:57:15 EDT 2009

>> I've modified some system files in /etc to define some global 
>> environmental variables ( export WHAT=foo ).  Those variables are 
>> available within the environment passed to a Terminal session (or 
>> when logged on at the text console) -- the command 'echo $WHAT 
>> $LANG' will emit "foo en_US.UTF-8".  But those same variables are 
>> undefined within the environment passed to an Activity launched by 
>> Sugar -- the command 'echo $WHAT $LANG' will emit "blank en_US.UTF-8".
> what system files did you modify?  i'm guessing it was a shell
> startup file, in which case it's not surprising that activities
> don't use those files.

I originally had the change in /etc/profile.  That's when I found 
that the environmental variable I wanted was not being passed to the 
Activity launched by Sugar, but was being passed to Terminal.

Next I tried having the setting in /etc/environment.  No difference.

Currently, my change is in /etc/profile.d/ -- that seems 
as clean a way to do it as any.  But still not passed where I want.

> Which /etc/ file did you modify? System wide variables go into /etc/environment

I tried that.  [Note that the syntax of /etc/environment is 
key=value (and is not interpreted), whereas in the other places in 
/etc it is a "normal bash command" that gets sourced.]  But even in 
/etc/environment, the variable did not get passed where I wanted.

Thanks,  mikus


   'set' issued from text console shows the variables I would expect,
   including the one I am trying to pass.

   'set' issued from the Activity shows various OLPC-related
   variables (including GABBLE_DEBUG), but not terminal-related
   variables (nor the one I am trying to pass).

   'set' issued from Terminal shows OLPC-related variables plus
   terminal-related variables plus the one I am trying to pass
   (plus variables from ~/.bashrc).

More information about the Devel mailing list