Fw: Bash script as root problem

Keith w7kew-linux at comcast.net
Sat Mar 23 16:39:10 UTC 2013



Begin forwarded message:

Date: Sat, 23 Mar 2013 09:34:29 -0700
From: Keith <w7kew at comcast.net>
To: ubuntu-users at lists.ubuntu.com
Subject: Re: Bash script as root problem


On Sat, 16 Mar 2013 22:32:02 +0100
Johnny Rosenberg <gurus.knugum at gmail.com> wrote:

> I have a bash script that I am going to run as root (sudo
> script_name), but in that script there is a line that I want to be
> executed as a regular user. Is that possible or do I need to do it the
> other way around, that is enter sudo at the beginning of every line
> except the one that I need to be run as a user?
> 
> 
> Johnny Rosenberg
> 
sudo -u username command

Just place it in your script.





More information about the ubuntu-users mailing list