Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Help with Unix find command

Re: Help with Unix find command

From: <mking2_at_ix.netcom.com>
Date: Thu, 10 Apr 2003 09:19:27 -0800
Message-ID: <F001.0057EEB0.20030410091927@fatcity.com>


Ron,

What do you mean not working? Could it be that you are only finding the ones in the current directory and not in the sub-directories?

Could there be a file in the current directory matching ${ORACLE_HOME}_exp_full*.log ??

If this is the case, Unix (prior to executing the find) will replace the pattern ${ORACLE_HOME}_exp_full*.log with the file name(s) of any local files that it finds. This means if there is a single file, in the current directory, it will be the only one found.

If this is the behavior you are seeing, try find . -name ${ORACLE_SID}_exp_full\*.log -mtime +1 -exec ls {} \;

This will prevent unix from expanding the *

Michael King
Compuware

-------Original Message-------
Sent: 04/10/03 08:58 AM
To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>

>
> I am trying to format a find command to delete files older than n days.
The command is in a script and incorporates the ORACLE_SID variable. I can't get the command to work with the first part of the file name as a variable.
It works fine if I hard code it. Any ideas?

Example: find . -name ${ORACLE_SID}_exp_full*.log -mtime +1 -exec ls {} \;

Thanks!
Ron
If you are not the intended recipient of this e-mail message, any use, distribution or copying of the message is prohibited. Please let me know immediately by return e-mail if you have received this message by mistake, then delete the e-mail message. Thank you.

-- 
Please see the official ORACLE-L FAQ: <a target=_blank
href="http://www.orafaq.net">http://www.orafaq.net</a>
-- 
Author: Smith, Ron L.
  INET: rlsmith_at_kmg.com

Fat City Network Services    -- 858-538-5051 <a target=_blank
href="http://www.fatcity.com">http://www.fatcity.com</a>
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


>
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: INET: mking2_at_ix.netcom.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Received on Thu Apr 10 2003 - 12:19:27 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US