What''s the "earliest" place one can set an environment variable during Linux boot process?

Posted by amn on Super User See other posts from Super User or by amn
Published on 2013-10-23T09:51:26Z Indexed on 2013/10/23 10:02 UTC
Read the original article Hit count: 157

I know I can set a variable in a shell startup file, but the thing is, I am trying to set up a POSIX-compatible environment, and a POSIX shell does not parse any startup files other than the one specified by the environment variable ENV. This presents a problem - currently my login starts the shell as bash, which I will try to replace with sh so Bash runs as POSIX shell - however then it will not parse the default startup files and I need ENV set to specify these. Which means as far as I understand that I need to specify ENV before login starts the shell, correct?

Now, how would I do that? I hope my question is clear, if not I will gladly redact it.

© Super User or respective owner

Related posts about login

Related posts about environment-variables