![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sending mails to various users without hard coding the email IDS | manas6 | UNIX for Dummies Questions & Answers | 9 | 06-03-2008 04:54 AM |
| Dynamic update loop query on Sybase database | Alaeddin | Shell Programming and Scripting | 10 | 12-13-2007 03:26 AM |
| Script file menus and coding | sinjin | UNIX for Dummies Questions & Answers | 0 | 12-11-2007 06:28 AM |
| COTS Software Versus (Hard) Coding in EP Applications | iBot | Complex Event Processing RSS News | 0 | 11-21-2007 03:50 AM |
| dynamic update of docs | sushil_d10 | UNIX for Advanced & Expert Users | 1 | 05-06-2005 06:07 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I wanted to update a script, more dynamic (just say no to hard coding)...
currently it has the following:
bdumpN=`ll /home/apps/oracle/admin/DBprod/bdump/DBprod_j* | grep "$Cdate" | wc -l` If I pass the DBname, I would not have to hardcode it in the script... I can capture the database name by adding the following: DBname=$1 The problem is, I have been unable to get the listing to work properly (the following do not work): bdumpN=`ll /home/apps/oracle/admin/$DBname/bdump/$DBname_j* | wc -l` and tried bdumpN=`ll /home/apps/oracle/admin/$DBname/bdump/$DBname"_j*" | wc -l` Both do not return the correct DBprod_j* files... If I run the command in-line, I get the following: # ll /home/apps/oracle/admin/DBprod/bdump/DBprod_j* | wc -l 8 here is a list of files: -rw-r--r-- 1 oracle dba 24716 Mar 4 06:01 /home/apps/oracle/admin/DBprod/bdump/DBprod_j000_10115.trc -rw-r--r-- 1 oracle dba 24917 Mar 8 06:01 /home/apps/oracle/admin/DBprod/bdump/DBprod_j000_13643.trc -rw-r--r-- 1 oracle dba 25099 Mar 9 06:01 /home/apps/oracle/admin/DBprod/bdump/DBprod_j000_14782.trc -rw-r--r-- 1 oracle dba 25237 Mar 11 06:01 /home/apps/oracle/admin/DBprod/bdump/DBprod_j000_16386.trc -rw-r--r-- 1 oracle dba 1090 Mar 9 18:34 /home/apps/oracle/admin/DBprod/bdump/DBprod_j000_21193.trc -rw-r--r-- 1 oracle dba 25196 Mar 10 07:46 /home/apps/oracle/admin/DBprod/bdump/DBprod_j000_29055.trc -rw-r--r-- 1 oracle dba 24915 Mar 7 08:25 /home/apps/oracle/admin/DBprod/bdump/DBprod_j000_29819.trc -rw-r--r-- 1 oracle dba 23426 Mar 6 00:00 /home/apps/oracle/admin/DBprod/bdump/DBprod_j001_10244.trc thanks, manny |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Try:
bdumpN=`ll /home/apps/oracle/admin/$DBname/bdump/${DBname}_j* | wc -l` |
|
#3
|
|||
|
|||
|
Perderabo, I owe you...it worked
thanks, manny |
|||
| Google The UNIX and Linux Forums |