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
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

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 03-14-2006
Registered User
 

Join Date: Oct 2005
Posts: 135
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
Reply With Quote
Forum Sponsor
  #2  
Old 03-14-2006
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,656
Try:
bdumpN=`ll /home/apps/oracle/admin/$DBname/bdump/${DBname}_j* | wc -l`
Reply With Quote
  #3  
Old 03-14-2006
Registered User
 

Join Date: Oct 2005
Posts: 135
Perderabo, I owe you...it worked
thanks,
manny
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 10:32 PM.


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

Content Relevant URLs by vBSEO 3.2.0