Why this linux command can affect the environment variables?
When I changed my current user to admin using
sudo su admin
I found that the environment variable changed too. What I intend to do is
to change my user to admin with the env not changed.
Then I found a command as follows:
sudo bash -c "su - admin"
This command does indeed what I want, but I googled about bash -c, with no
clue to why this command can do that for me. Could anyone give me a clear
explanation? Thanks a lot.
No comments:
Post a Comment