1
vote
3answers
160 views

How to exit the super user from middle of shell script?

I have a shell script in which most of the commands need to be run under sesu user and then I need to run some commands as current user. Can you please help me in this?
1
vote
2answers
3k views

What happens to the environment when you run “su -c”?

What happens to the environment when you run "su -c"? The reason I ask, is this mysterious behavior: bash$ which firefox /usr/local/bin/firefox bash$ su - user -c "echo $PATH" ...
21
votes
2answers
48k views

Command: sudo su -

I understand what su - does logs you into root with the root environment (as opposed to su which logs you into root with your environment) And I understand what sudo does you are root for one ...