![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Shell script that reads from configuration file to get database | dolo21taf | Shell Programming and Scripting | 1 | 04-15-2008 07:47 PM |
| search for the contents in many file and print that file using shell script | cdfd123 | Shell Programming and Scripting | 3 | 10-07-2007 10:17 PM |
| Shell script to return all the ID's from file based on the distribution ID search | kumbhatalok | UNIX for Dummies Questions & Answers | 1 | 10-06-2006 12:53 PM |
| Creating file contents using contents of another file | ReV | Shell Programming and Scripting | 21 | 02-24-2006 10:25 AM |
| awk script to split a file based on the condition | superprogrammer | Shell Programming and Scripting | 12 | 06-14-2005 03:59 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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. |
|
||||
|
THANKS both of you guys! One minor adjustment I made though...specifically I need just the table name out of the line, not the entire line, so I used $2 to print to the file instead of $0...Thanks though!
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|