-   Programming (
-   -   command result as varible (

mkiler 03-10-2009 11:19 AM

command result as varible
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:

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

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