linux shell show slave status acquisition method

linux shell show slave status acquiring method
<pre>
# / bin / the bash!
Array = ($ (-u MySQL database account password database -p -e "show slave status \ G" | grep "Running" | awk '{print $ 2 } '))
IF [ "$ {Array [0]}" == "Yes"] && [ "$ {Array [. 1]}" == "Yes"]
the then
echo "Slave IS the OK"
the else
echo "Slave IS Wrong "
fi
</ pre>
do not forget to enter the account number and password database

 

Guess you like

Origin www.cnblogs.com/newmiracle/p/11872646.html