Tiny Core Linux
Tiny Core Extensions => TCE Q&A Forum => Topic started by: whoisterence on January 28, 2011, 10:58:43 PM
-
Trying to set some environment variable in extension script.
For example, created extension scim.tcz with the script in usr/local/tce.installed/scim (file permission: -rwxr-xr-x 1 root root)
...
export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE=scim
export QT_IM_MODULE=scim
...
but the variables are not set, because when I echo $XMODIFIERS after loading tcz, it's empty. How to do this?
-
You can't.
You will have to modify a profile or rc file.
-
isn't /etc/profile.d used for this purpose ?
just put a file say scim.sh under /etc/profile.d
in this case scim.sh would be:
export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE=scim
export QT_IM_MODULE=scim
a relogin or reboot is needed for changes to take effect
-
Hi whoisterence
Try this:
source scim
That should do what you are looking for.
-
... or reboot is needed for changes to take effect
AFAIK the re-login should be enough (but a re-boot being the more "drastic" measure would work as well).
The critical thing from my POV would be that the file in '/etc/profile.d' has a *.sh name, and is available early enough for the inital login. The latter point should be feasible either by inclusion to the backup, or via an OnBoot extension.
-
Rich, 'source scim' would work at prompt, but scim.sh is suppose to run at extension mount which doesn't source the extension script.
The purpose of scim is to try to export the variables system-wide.
/etc/profile.d sounds like the extension must be loaded at boot.
-
/etc/profile.d sounds like the extension must be loaded at boot.
Yes. There is no way to inject variables to a running session.