Email alerts - Commands

"Joe Leone" <[email protected]>
Newsgroups gmane.network.netsaint.user
Message-ID <[email protected]>
Hi, I am trying to run a command as a specific user (eg netsaint).  In the commands.cfg file I have the following definition.  

command[email_user]='/usr/bin/su - netsaint -c "/usr/bin/printf 'TEST NETSAINT test from commands file  $HOSTADDRESS$*' | /usr/ucb/mail -s "TEST $HOSTNAME$" [email protected]"'

However netsaint puts out the following error message. 

sh: /usr/bin/su - netsaint -c "/usr/bin/printf TEST: not found
The command does run from the prompt. I have also tried with a variety of different quote combinations

The ultimate aim is to have mail being send out from user netsaint not root.  (I asked this question before, but did not solve it) 

Thanks Joe


-------------------------------------------------------
This sf.net email is sponsored by: Dice - The leading online job board
for high-tech professionals. Search and apply for tech jobs today!
http://seeker.dice.com/seeker.epl?rel_code1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.