Bash script as root problem

Gene Heskett gheskett at wdtv.com
Sun Mar 17 13:11:09 UTC 2013


On Sunday 17 March 2013 09:06:32 Nils Kassube did opine:

> Gene Heskett wrote:
> > On Sunday 17 March 2013 07:47:49 Colin Law did opine:
> > > On 17 March 2013 00:19, Gene Heskett <gheskett at wdtv.com> wrote:
> > > > On Saturday 16 March 2013 20:18:40 Bill K. Dengler did opine:
> > > >> su -c "command_7" $USER
> > > > 
> > > > Wrong syntax Bill, its
> > > > su user -c "command_7"
> > > 
> > > man su says
> > > su [options] [username]
> > 
> > Go ahead.  Try it Colin, I'll wait. ;)
> > 
> > BTDT, the man page is incomplete and has been so for nearly 15 years.
> 
> I'm not Colin, but this is what I get:
> 
> # echo $USER
> root
> # su nils -c 'echo $USER'
> nils
> # su -c 'echo $USER' nils
> nils
> 
> > Now, if we could just get someone to actually fix the %@$#&@( man page
> > so we don't have this argument everytime someone wants run su, not to
> > get root, but to get another user from root.  There is a difference.
> 
> Hmm, if you have this argument for 15 years I would expect that someone
> told you already that both versions work equally well. :)
> 
> 
> Nils

Humm, I'll be dipped, it works here too.  When I first started using 
amanda, a good 13 years ago, it did not so I was forced to play 10,000 
monkeys and invent a syntax that did work.  Maybe they fixed su?  Probably 
easier than fixing the man page I guess.  Sigh...  I'll get me coat.

Cheers, Gene
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
My web page: <http://coyoteden.dyndns-free.com:85/gene> is up!
My views 
<http://www.armchairpatriot.com/What%20Has%20America%20Become.shtml>
The first rule of intelligent tinkering is to save all the parts.
		-- Paul Erlich
I was taught to respect my elders, but its getting 
harder and harder to find any...




More information about the ubuntu-users mailing list