General TC > Programming & Scripting - Unofficial
exporting from shellscript
(1/1)
halma:
hi,
i am trying to get ccache extension working under TC9.x/x64
i have an ccache tce.installed script which creates the symlinks for ccache compilers on bootup, but i need to
set an $PATH environment variable too. Usually each shellscript has its own process structure/childs/parent.
Someone has an idea how it is possible to set an $PATH environment variable which is like global avaible ?
what i tried so far:
--- Code: ---#!/bin/sh
echo "#!/bin/sh" > export-variable-script.sh
echo "" >> export-variable-script.sh
echo "export foo=bar" >> export-variable-script.sh
chmod u+x export-variable-script.sh
source ./export-variable-script.sh
--- End code ---
but
--- Code: ---echo $foo
--- End code ---
returns nothing
if possible the code should be undependend, not set export in ~/.bashrc or ~/.profile
Thanks
Rich:
Hi halma
Setting it in ~/.profile would probably be the simplest solution. After adding it to ~/.profile you'll need to logout/login or
reboot for it to take affect.
Navigation
[0] Message Index
Go to full version