"exec env -i" doesn't seem to work. What am I doing wrong?
Section 4.4 of LFS 6.7 includes the following text -
Code:
Set up a good working environment by creating two new startup files for the bash shell. While logged in as user lfs, The problem is that after creating this file and starting a new logon shell as user lfs, and use "set" to list variables, I find that I still have all the host system variables set. The empty environment referred to doesn't happen. It seems like the "exec env -i" command just isn't working. Anyone got any ideas? The host is Debian Squeeze. Thanks spoov |
Hi,
Which variables are you talking about? After becoming user lfs I see 40 defined variables, if I remove .bash_profile I see 54 (.bashrc is present). Try removing .bash_profile, log in again and check the difference in the output of the set command (do remember to create .bash_profile again after testing). If the problem still exists: Quote:
Hope this helps. |
Thanks I think i've (kindof) figured it - it's something to do with "set" command. If I list variable with "env" then I get the results I would expect. Using "set" gives very strange results though. See below ('m starting from a newly opened shell (terminator, opened via openbox menu).
Code:
[spoovy@poppy-debian:~] $ set > file2 Code:
|
Hi,
env shows only the environment, set shows all variables. As stated before I also come up with 40 if I run set | wc -l. Guess you're problem is solved (if it is mark it as such: First post -> Thread Tools). |
Hmm. As well as variables, set also returns a huge barrage of code after the variables when run from a login shell (I wont post it here as there's 8,700+ lines). I don't know if this is the proper behaviour?
I'm assuming that my x-launched terminal is not a login shell (though I thought these were login shells - you learn something every day). |
Hi,
No need to worry, at all. The set command shows everything that is set during the login process and there are big differences in the amount of lines when counted. To give you an example: My LFS box has 109 lines total and my debian squeeze box has 8823 lines total when running set | wc -l....... The outcome of the env command should be a lot closer together (LFS 42, Debian 38 on my boxes). Hope this helps. |
Thanks, yeah 40 and 57 respectively for me when using env. Cheers druuna, marking as solved.
|
You're welcome :)
|
All times are GMT -5. The time now is 05:01 PM. |