Mailinglist Archive: opensuse (3637 mails)

< Previous Next >
[OT] Using su -c
  • From: wilson@xxxxxxxxxxx (Jonathan Wilson)
  • Date: Thu, 24 May 2001 17:11:37 -0500
  • Message-id: <5.1.0.14.0.20010524170833.02731158@xxxxxxxxxxxxxxxx>
Howdy,

a while ago I figure out how to us su -c in a shell script to run a command as another user. For instance, most of the script needed to be run as root, but a portaion that used wget and made a log file I wanted to run as "jw". I had it working nicely, but have lost that script and can't get
"su -c" to work at all now.

Anyone know the correct syntax? I thought it was something like:

su -c $( echo "hi!") jw

or

su -c `echo "hi!"` jw

But those always fail.

TIA

----------------------------------------------------
Jonathan Wilson
System Administrator

Cedar Creek Software http://www.cedarcreeksoftware.com
Central Texas IT http://www.centraltexasit.com


< Previous Next >