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: <>

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


su -c `echo "hi!"` jw

But those always fail.


Jonathan Wilson
System Administrator

Cedar Creek Software
Central Texas IT

< Previous Next >