Re: su within script question

From: Vwakes (
Date: 09/04/03

Date: Wed, 3 Sep 2003 19:27:58 -0700

On Wed, 3 Sep 2003 Pamela Bratcher wrote:

>In my startup script, I want to su to another user (that doesn't have a
>password) and then run a command as that user.

If you are root then you don't need the password anyways. This is what I
have in my rc.local script:

su news -c "/usr/local/sbin/fetchnews -v &"

The & just makes it run in the background.

>How can I do this?

man su