× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Dennis & Scott,

Sorry, I left out the -mtime, what I'd actually be doing is:
find /mydir/???? .fin.cis0000.staf.input01.????????.zip -mtime +30
-type f –exec rm {} \;')

Thus the use of find :)

As far as why the shell isn't expanding the wild card, I was referring
to this statement of Scott's
Technically speaking...
find /mydir/*.java
_does_ recurse. It recurses into all directories that end with *.java.
But, since folks don't typically use that name for directories, it
/effectively/ stops recursion.

Which I took to mean that find was seeing the *.java instead of the
shell expanding it...

But perhaps the shell _is_ expanding it, and since the resulting list
doesn't have any directories in in find doesn't recurse?

As far as the find + rm combo not being very efficient, given that we
(should) be running this daily and there should only be one file per
day, it shouldn't be a factor.

Thanks for your help gentlemen!

Charles


On Mon, May 17, 2010 at 12:41 PM, Scott Klement
<midrange-l@xxxxxxxxxxxxxxxx> wrote:
Hi Charles,

Two questions:
  why doesn't the shell handle the wild card?

Depending on which example you're referring to... either the shell DOES
handle the wildcard, or it doesn't handle it because you escaped the
wildcard character.

If you want more detail, please show me the statement you're referring to...




Assuming I don't have and subdirectories that match the name, would
this bite me in some way?
find /mydir/????.fin.cis0000.staf.input01.????????.zip –exec rm {} \;


As Dennis pointed you, you really don't need to use 'find' for something
like this.  The way you have it coded, it'll submit a new background job
for every file that matches your ???? expression.  While that'll work,
it's rather inefficient.

You could do this instead:
   rm /mydir/????.fin.cis0000.staf.input01.????????.zip

That'll accomplish the same thing, and will do it all in one job -- much
more efficient.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.