LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   command result as varible (https://www.linuxquestions.org/questions/programming-9/command-result-as-varible-710506/)

mkiler 03-10-2009 11:19 AM

command result as varible
 
Hi
I'm trying display only a few information from result returned by script.

My reslult is like:

PHP Code:

backends:0 commits:1837 rollbacks:3 read:0 hit:0 ret:0 fetch:0 ins:0 del:0 dbname:postgres 

and I need display only backends:0 (and later make rrd file).

How to division result to part?

crabboy 03-10-2009 11:22 AM

provided that backends is always the first field you can do this:
Code:

$ echo "backends:0 commits:1837 rollbacks:3 read:0 hit:0 ret:0 fetch:0 ins:0 del:0 dbname:postgres" | cut -d ' ' -f1
backends:0



All times are GMT -5. The time now is 09:38 PM.