help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] Regarding sudo


From: Greg Wooledge
Subject: Re: [Help-bash] Regarding sudo
Date: Wed, 22 Jun 2016 10:43:57 -0400
User-agent: Mutt/1.4.2.3i

On Wed, Jun 22, 2016 at 03:55:40PM +0200, Bipul kumar wrote:
> I have bash script which runs in sudo user mode. But i would like to make
> my script to get into normal mode and then perform the task.
> is there anyway to do? your all support and suggestions will be greatly
> appreciated.

sudo is not a "mode".  It's a command.

I'm assuming you mean that you are typing a command like this one to
run your script:

sudo myscript

This means your script is executed after sudo has switched to a different
user ID.

If you only want PART of your script to run with a different user ID, then
you need to place the sudo command inside the script.  Use it for the
part(s) of the script that require different privileges, and don't use it
for the parts that should run with the caller's privileges.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]