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?
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" ...
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 ...