#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    147
    Rep Power
    15

    Get value by parsing string


    How can I get the number of threads from the following string?

    Uptime: 32127 Threads: 1 Questions: 13647 Slow queries: 19 Opens: 2568 Flush tables: 1 Open tables: 64 Queries per second avg: 0.425
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Posts
    210
    Rep Power
    31
    What OS and shell are you using?
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    147
    Rep Power
    15
    I ended up doing
    cut -d" " -f5

    thanks
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Posts
    210
    Rep Power
    31
    Ahhhh... I always forget about the cut command. I don't think there is an UNIX OS in existance without it. Glad you got it figured out.

IMN logo majestic logo threadwatch logo seochat tools logo