Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Execute program as su 1

Status
Not open for further replies.

JAFrank

Technical User
Nov 16, 2002
84
US
Ok, I know I should know how to do this, but apparently there's a dead brain cell right there....

I need to run a program from the command line as su - can someone help me with the syntax?

Thanks!

Allen
 
Hello,

If you want to mantain your environment:

su username -c comand_string

and if you want the environment of the user you switch to:

su - username -c command_string


Take a look at the man pages for other available options or just post for additional info.

Bye,

jmiturbe
 
Thank you, that was exactly what I needed.

Have a star, on me!

Allen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top