Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
    
Try adding ENV= to the kernel command line. You would have to edit this in grub or whatever bootloader is used. –  sawdust Oct 23 '13 at 18:59
    
I did, but the variable doesn't show up in any shell and is not even listed under any of the relevant processes (init, systemd-*, login, agetty) when inspecting /proc/$pid/environ. I too thought that was the solution, but it didn't work. I am suspecting that the variable is passed to the kernel, however it is supressed/removed shortly thereafter. –  amn Oct 24 '13 at 7:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.