I'd like to set a couple of environment variables (at boot time) on an Ubuntu machine (10.04), but I want to create their value via a script, much like:
export THE_ENV_VAR=$(script_to_execute_and_use_stdout_from)
- The reason I want to do this is that the commands used to set the environment variables take long time to execute (10s or so), so that's why I only want to do it once after boot. Anyway, currently I solved this by caching the result of the command at boot time, so that subsequent calls will go fast, thus not using env. variables at all.
I've tried setting in /etc/environment, but that only copies rhs verbatim
I've tried executing a script in /etc/init.d/ at startup, but that does not seem to work.
Ideas?