scripting

Hi all
Can sombody tell me how can i run a script as a regular user and then change in the middle of the script to root,perform a task that needs root permisions and get back to the regular user

That's not possible unless the script is a suid script owned by root(which has security implications right there :o ). But then again, if it were suid... the script would be running as root wouldn't it? haha :stuck_out_tongue:

I suppose you can put a line that runs sudo on a command in a script... but not sure how well that would work or not... :eek: