LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-23-2003, 05:22 AM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 31
Extract data


Sorry to ask such simple question there , but I really want to have a suggestion.

I have a text mode program (run on unix shell)to monitor the db preformance , I would like to extract some data from this program, the program like these:

# dbmon ./ordb

DB MONITOR

Database: /usr/local/bin/db/ordb

1. System activities
2. Locking and Waiting Statistics


When I press "2" key , then go to the next screen

Locking and Waiting:

Type Usr Name Record Trans Schema
Lock 999 TOTAL... 254999 17 0
Wait 999 TOTAL... 0 0 0
Lock 0 root 0 0 0
Wait 0 root 0 0 0

What I want is to extract the data "999 TOTAL... 254999 17" .
My problem is I must manually press the "2" key then to go to the next screen , I want the program can extract this data into a text file automatically and reqularly but no need to interactively to press any key , could suggest can can I do ?

I am not sure whether it is clear to understand , but I am very wellcome to answer if any point is
 
Old 10-23-2003, 05:45 AM   #2
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
You can write a simple bash script and use expect to do it. Read the Advanced Bash Scripting Guide (avaiable at tldp.org) and type man expect for the expect manpage.

Håkan
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Software to acess and recover data on Fat32 data NeoSpawn Linux - Software 2 09-04-2005 11:37 AM
appending data to a data grid VB.net mrobertson Programming 6 07-28-2005 08:57 AM
Home Office Biotech Data Mining - Data Collection Adler Linux - General 20 11-03-2004 04:17 AM
Burn Data DVD... Read Data in Linux and Windows SaintStrive Linux - Newbie 3 09-18-2004 05:04 PM
Extract data from disk, without partition table... mandatory Linux - General 1 10-20-2003 06:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration