Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update script.py #28

Merged
merged 1 commit into from
Jun 9, 2015
Merged

Update script.py #28

merged 1 commit into from
Jun 9, 2015

Conversation

alex94cp
Copy link
Contributor

@alex94cp alex94cp commented Jun 9, 2015

What I meant was that os.getenv('HOME') should work since sudo sh -c "echo $HOME" shows that sudo doesn't change $HOME, but sudo python -c "import os; print(os.getenv('HOME'))" gives "/root", so it wouldn't work. These changes should make it work now and code is clearer.

This should work
@bilelmoussaoui
Copy link
Owner

It's does the same thing :P Using os.getenv("HOME") or what i did have the same result?

@alex94cp
Copy link
Contributor Author

alex94cp commented Jun 9, 2015

In my system, sudo python3 -c "import os; print(os.getenv('HOME'))" gives "/root". It SHOULD give my homedir. I'm confused, maybe it's because of different compilation flags used in Fedora's sudo, or python's, but the current solution should work in all systems. (Don't trust me, check it out!) :)

@bilelmoussaoui
Copy link
Owner

Well, it does the same thing, your code works fine for me too, i will merge this and change it if anyone is having any issues with it ;)

bilelmoussaoui added a commit that referenced this pull request Jun 9, 2015
@bilelmoussaoui bilelmoussaoui merged commit 4498559 into bilelmoussaoui:master Jun 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants