Hi all,
I'm currently attempting to script something that checks 'zmcontrol status' and attempts to start services if they have failed (it will be growing beyond that, but this is the basic need).
At present I run 'zmcontrol status' and strip the output down to just a list of running services. I then try to store this in an array. However for some reason my array only ever seems to contain one item (the entire list).
For instance if I run:
Code:
#!/bin/bash
running=`su - zimbra -c "zmcontrol status"|grep Running| awk '{print $1}'|tr "\n" " "`
echo ${running[0]} I get the following:
Code:
antispam antivirus ldap logger mailbox mta snmp spell stats
Could someone kindly point out what I am missing? As I've been scratching my head with this for a while now.