yes, fix I've proposed works for me.
RES=`HOME=/var/lib/zabbix mysql -e 'SHOW SLAVE STATUS\G' | egrep '(Slave_IO_Running|Slave_SQL_Running):' | awk -F: '{print $2}' | tr '\n' ','`
should work as well but defining HOME in the beginning is more clear, imho. It will be also easier to describe that in docu.
yes, fix I've proposed works for me.
RES=`HOME= /var/lib/ zabbix mysql -e 'SHOW SLAVE STATUS\G' | egrep '(Slave_ IO_Running| Slave_SQL_ Running) :' | awk -F: '{print $2}' | tr '\n' ','`
should work as well but defining HOME in the beginning is more clear, imho. It will be also easier to describe that in docu.