Monday, 26 August 2013

BASH string parsing

BASH string parsing

I need to write a script to perform some magic on a long string and change
the output. I can easily do most of the scripting except for one part.
If I have a bash script that has
data = "CRITICAL - mempool lsmpi_io usage is 99.99%, mempool Processor
usage is 34.38% | 'Processor_usage'=34.38%;80;90
'lsmpi_io_usage'=99.99%;80;90"
I need the information that always comes after "'Processor_usage'="
What commands do I need to do to make
$p=34.38
$w=80
$c=90
Keeping in mind that the percent could be just a single digit.
Thanks!

No comments:

Post a Comment