- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- su root -c command
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2006 06:30 AM
тАО03-02-2006 06:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2006 06:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2006 06:35 AM
тАО03-02-2006 06:35 AM
Re: su root -c command
mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2006 06:36 AM
тАО03-02-2006 06:36 AM
Re: su root -c command
The command says to switch the user to be "root" and then as the root user, run the command specified byt eh $COMMAND2 variable.
Since the 'su' was of the form without a hyphen, as in 'su -', the login profile of the target user (here, "root") is *not* run first, before the command ($COMMAND) is executed. See the manpages for 'su' for more information.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2006 06:55 AM
тАО03-02-2006 06:55 AM
Re: su root -c command
$COMMAND2 is a command, could be a s simple as "date".
su - root -c "/usr/bin/date"
would run the command date as root (it would prompt for root password).
More common to see root running commands (no password required)
IE:
as root:
su - oracle -c "start_all.sh"
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2006 08:38 AM
тАО03-02-2006 08:38 AM
Re: su root -c command
cheers!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2006 02:50 PM
тАО03-02-2006 02:50 PM
Re: su root -c command
su -c is used for passing a single COMMAND to the shell.
Ex;
I am a root user, wants to execute a ls command as "rtp40" user, then execute this command;
kassel1:~ # su - rtp40 -c ls
1.sh compo ctxminitool Documents MgmtBadParamCheck.java tstclasses
kassel1:~ #
HTH,
Prabu.S