![]() |
|
|
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 |
| How to Read config (.cfg) files using shell scripting | smallwonder | UNIX for Advanced & Expert Users | 5 | 03-02-2007 12:37 AM |
| rename files using shell scripting | gfhgfnhhn | Shell Programming and Scripting | 4 | 07-04-2006 05:37 PM |
| why shell scripting takes more time to read a file | brkavi_in | Shell Programming and Scripting | 1 | 06-23-2006 09:20 AM |
| How to write Flat Files by shell script using Oracle Database | coolbuddy | UNIX for Advanced & Expert Users | 3 | 02-21-2006 02:50 PM |
| How To create Flat Files using Unix Shell Script? | Aparna_k82 | Shell Programming and Scripting | 4 | 02-10-2005 05:49 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
how read the flat files from shell scripting
We are using sybase data base and we have the data base name called MasterDB. The data baase MasterDB contains 100's of tables like sample1, sample2, sample3...etc...sample100 To take the count of every table we have to execute the following commands use MasterDB //DB name go //execute command in sybase select count(*) from sample1 // command to find the count of table go //execute the command This is the way to take count. Likewise manually we have to take 100 tables count...we have to automates this though shell scripts. What I did here is, I write all table names in the flat file and trying to read the flat files from the scripts Code:
#!/bin/ksh PATH=temp/flat_file srv=sybaseserver uid=operator log=$LOGS/rowcount.log pwd=`cat $SYBASE/.operatorpwd` CP_CONN="-U$uid -S$srv -C3433 -b100000" echo "count of table Started at: `date`" > $log echo >> $log echo "-------------------------------------------------------" >> $log echo 'Setting table count..' >> $log isql -U$uid -S$srv << EOF >> $log $pwd use customers go print 'taking count from tables..' go while read line do select count(*) from $customer_table \n go done < outfile.dat i know its incorrect logic..pls help me onthis Last edited by Yogesh Sawant; 04-01-2009 at 02:40 PM.. Reason: added code tags |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|