The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Riddle - solve it if you can numstr Shell Programming and Scripting 1 08-15-2007 09:52 AM
How to solve this akashag22 Shell Programming and Scripting 3 07-21-2007 02:54 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-23-2005
Registered User
 

Join Date: Feb 2005
Posts: 1
Can AWK solve it ???

Hi

I have some 200 tables and I have macro which actually returns the tables columns descriptions . Say for exapmle describe('table1') will list all the columns of table one with the description.

Now what I want to do is I want to write a shell script which will take tables name from a file and will execute the macro and redirect the output into file .
I will take care the database connection part and extraction just tell me how write that script where it will take table name from a file one by one ????

Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 02-23-2005
bhargav's Avatar
Registered User
 

Join Date: Sep 2004
Location: USA
Posts: 511
file1 contains all table names

Code:
#!/usr/bin/ksh

while read tablename
do

   echo "describe('$tablename')"

done < file1
Redirect the output to a file

You get the file with all desribe macro of all tables
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 08:09 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0