display 2nd part of variable in a shell script
ok, linux saavy, still need to sit in a cave for a week and learn sed/awk as it seems that's always the answer! Well I am remotely monitoring mysql, now want to graph the slave status. I have the following one line which works fine;
mysql -P 3306 -h host -e 'show slave status \G' | grep 'Seconds_Behind_Master'
Seconds_Behind_Master: 0
The monitoring app can take the value, graph it, I can trigger alarms, etc. so I need to only display the value, so I want to say just 0 (or whatever the value is. The Seconds_Behind_Master: is always exact so if I need to count characters and say after that is fine, or some other way, I am sure its simple for the right person/people, but I do want to get the scripting down more!
Tnx
|