Sponsored Content
Top Forums Shell Programming and Scripting sh script that reads/writes based upon contents of a file Post 302079589 by rdudejr on Tuesday 11th of July 2006 04:06:34 PM
Old 07-11-2006
CPU & Memory sh script that reads/writes based upon contents of a file

Hi everyone,

Ive got a quick question about the feasibility and any suggestions for a shell script. I can use sh or ksh, doesnt matter. Basically, Ive got an output file from a db2 command that looks like so:

SCHEMA NAME CARD LEAF ELEAF LVLS ISIZE NDEL KEYS F4 F5 F6 F7 F8 REORG
-------------------------------------------------------------------------------------------------
Table: DB2INST2.ADVISE_INDEX
DB2INST2 IDX_I1 4 1 0 1 10 0 2 100 - - 0 0 -----
DB2INST2 IDX_I2 4 1 0 1 24 0 4 100 - - 0 0 -----
Table: DB2INST2.ADVISE_INSTANCE
SYSIBM SQL060710185042710 2 1 0 1 10 0 2 100 - - 0 0 -----
Table: DB2INST2.ADVISE_MQT
DB2INST2 MQT_I1 - - - - - - - - - - - - -----
DB2INST2 MQT_I2 - - - - - - - - - - - - -----
Table: DB2INST2.ADVISE_PARTITION
DB2INST2 PRT_I1 - - - - - - - - - - - - -----
Table: DB2INST2.Active_Server_Pages
DB2INST2 ACTSRVPG_IDX - - - - - - - - - - - - -----
Table: DB2INST2.Active_Server_Pages_D
DB2INST2 ACTSRVPG_DX 8622 127 0 3 97 0 8622 65 89 52 0 0 *----
DB2INST2 ACTSRVPG_DX2 8622 41 0 2 82 0 2889 76 90 2 0 0 *----
Table: DB2INST2.Active_Server_Pages_H
DB2INST2 ACTSRVPG_HX 20492 302 0 3 97 0 20492 7 89 22 0 0 *----



If any of you are db2 dba's, youll recognize its the output for reorgchk. Basically what im trying to do is to move the string after "Table: " to a differnt file if any of the output between it and the next occurance of "Table: " contains a star(*). Im thinking I would need to use SED to somehow extract that block of text, put it in another file, place the schema.tablename (in the last case it is DB2INST2.Active_Server_Pages_H) in a variable, grep that file for the star, and if it exists (no matter how many occurances), then write that variable that has the schema.tablename to another file enclosed in a command that I already have (will be reorg table). Any takers on the feasibility of this? Please request clarification if nessesary.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script that reads from configuration file to get database

Hi intelligent beings, I am trying to write a script that 1. Accepts the following arguments: store_number div_number user_id div_code 2. Will read from a configuration file to get the Database 3. Use the div_code to determine which value to retrieve from the configuration file ... (1 Reply)
Discussion started by: dolo21taf
1 Replies

2. Shell Programming and Scripting

identify the unix processes performing high disk i/o reads and writes

I would like to write shell/perl script which identifies the top unix processes that are performing high disk I/O's or/and writes If any one knows the solution please help me? -Swamy (0 Replies)
Discussion started by: avsswamy
0 Replies

3. UNIX for Advanced & Expert Users

identify the unix process performing high disk i/o reads and writes

Guys, Is there any UNIX command that captures the 'Unix process which is performing high disk I/O reads and writes'. can you help me in this? -Swamy (6 Replies)
Discussion started by: avsswamy
6 Replies

4. Shell Programming and Scripting

Problem with Script that writes max lines of a file - Any ideas how to fix?

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (4 Replies)
Discussion started by: mmiller99
4 Replies

5. Filesystems, Disks and Memory

Does vmstat -d give a count of actual physical writes/reads done to/from hard disk?

Hi, I am trying to find the reliability of 'vmstat -d' for showing the actual physical writes on sectors on hard disk. Can anyone please tell me if the numbers in the "sectors" field under "read" or "write" headers show a count of the actual write commands sent to disk from the low level... (2 Replies)
Discussion started by: jake24
2 Replies

6. Filesystems, Disks and Memory

Life span of HDD - maximum reads/writes etc

Hi All I was wondering how the copying of vast amounts of data affected the overall lifespan of an HDD. In my example, I'm copying approx 120GB (250,000) of files, once per hour from disk to another. Is this likely to have a detrimental effect on the disk in terms of reads/writes etc? ... (2 Replies)
Discussion started by: huskie69
2 Replies

7. UNIX for Dummies Questions & Answers

Difference between buffered disk reads and cached reads?

I was analyzing the Disk read using hdparm utility. This is what i got as a result. # hdparm -t /dev/sda /dev/sda: Timing buffered disk reads: 108 MB in 3.04 seconds = 35.51 MB/sec # hdparm -T /dev/sda /dev/sda: Timing cached reads: 3496 MB in 1.99 seconds = 1756.56 MB/sec... (1 Reply)
Discussion started by: pinga123
1 Replies

8. Shell Programming and Scripting

Help with script that reads and writes java console Minecraft

Hi I am looking for an easy way to lock game mode (0) for everyone included op on a Minecraft server. It can be a script that every time a player changes game to 1 the script changes back to 0. What the player writes is visible in the java console. I am not good at script programming and my... (0 Replies)
Discussion started by: MyMorris
0 Replies

9. Shell Programming and Scripting

File comparison based on contents

Hi I have 2 files 1.del ---- 1,2,3,4,5 1,2,3,4,4 1,1,1,1,2 2.del ---- 1,2,3,4,5 1, 1,2,3,4,4 1,1,1,1,2 I need to compare the above two files in unix, as in the output should only tell the difference in contents as I should get only the line 1 ( from 2.del) , rest all lines are... (4 Replies)
Discussion started by: Ethen561
4 Replies

10. Shell Programming and Scripting

Shell Script that reads a file

I have below script to read a file line by line. How can I ensure that the loop will stop after last line. #!/bin/bash while read -r mod ver tarball; do echo $mod done < taskfile.txt (4 Replies)
Discussion started by: aderamos12
4 Replies
Table(3pm)						User Contributed Perl Documentation						Table(3pm)

NAME
Tk::Table - Scrollable 2 dimensional table of Tk widgets SYNOPSIS
use Tk::Table; $table = $parent->Table(-rows => number, -columns => number, -scrollbars => anchor, -fixedrows => number, -fixedcolumns => number, -takefocus => boolean); $widget = $table->Button(...); $old = $table->put($row,$col,$widget); $old = $table->put($row,$col,"Text"); # simple Label $widget = $table->get($row,$col); $cols = $table->totalColumns; $rows = $table->totalRows; $table->see($widget); $table->see($row,$col); ($row,$col) = $table->Posn($widget); DESCRIPTION
Tk::Table is an all-perl widget/geometry manager which allows a two dimensional table of arbitary perl/Tk widgets to be displayed. Entries in the Table are simply ordinary perl/Tk widgets. They should be created with the Table as their parent. Widgets are positioned in the table using: $table->put($row,$col,$widget) If $widget is not a reference it is treated as a string, and a Lable widget is created with the string as its text. All the widgets in each column are set to the same width - the requested width of the widest widget in the column. Likewise, all the widgets in each row are set to the same height - the requested height of the tallest widget in the column. A number of rows and/or columns can be marked as 'fixed' - and so can serve as 'headings' for the remainder the rows which are scrollable. The requested size of the table as a whole is such that the number of rows specified by -rows (default 10), and number of columns specified by -columns (default 10) can be displayed. If the Table is told it can take the keyboard focus then cursor and scroll keys scroll the displayed widgets. The Table will create and manage its own scrollbars if requested via -scrollbars. The table can be emptied using $table->clear the widgets which were in the table are destroyed. The Tk::Table widget is derived from a Tk::Frame, so inherits all its configure options. BUGS
/ Snags / Possible enhancements o Very large Tables consume a lot of X windows. o No equivalent of pack's -anchor/-pad etc. options SEE ALSO
Tk::grid, Tk::HList, Tk::TableMatrix, Tk::MListbox, Tk::Columns perl v5.14.2 2010-05-29 Table(3pm)
All times are GMT -4. The time now is 08:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy