[Cialug] A little shell-script like help?

Barry Von Ahsen barry at vonahsen.com
Sun Oct 18 11:21:26 CDT 2009


you need a backslash:

"echo \" %t %e of %c %l \" ...


-barry


Nathan C. Smith wrote:
> 
> I'm trying to configure Bacula to send me the results of operations and requests for interventions using jabber.  I'm not sure what needs to be escaped or how.
> 
> Here is what the native mailcommand looks like in the Bacula configuration file.
> 
> mailcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula daemon message\" %r"
> 
> And sendxmpp has worked well for me like this from the command line:
> 
> echo "hello" | sendxmpp -u username -p password  -j jabber.domain.com recipient at jabber.domain.com
> 
> So I'm trying to combine them but I'm unfamiliar with all the escaping I will need to do for quotes within quotes and not sure of all the rules related to the use of the echo command.  Is the /" enough to escape and include the quotes in the command?  I'm happy to hardcode the XMPP settings I will need.
> 
> mailcommand = "echo /" %t %e of %c %l  /" | /usr/bin/sendxmpp -u username -p password -j jabber.domain.com username at jabber.domain.com"
> 
> Thanks for any assistance.
> 
> -Nate
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> http://cialug.org/mailman/listinfo/cialug



More information about the Cialug mailing list