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
Problem with find and tar venu_nbk UNIX for Dummies Questions & Answers 2 11-20-2006 07:41 AM
problem with find braindrain Shell Programming and Scripting 2 03-29-2006 09:33 AM
how to find Script file location inside script asami Shell Programming and Scripting 10 03-14-2006 09:57 PM
Problem with `find ...` Cameron Shell Programming and Scripting 4 08-10-2005 04:24 AM
Another Find Problem sethkor Shell Programming and Scripting 6 02-24-2005 04:56 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 04-27-2008
Registered User
 

Join Date: Feb 2008
Location: New Zealand
Posts: 44
Problem with find in script

Hi

I am updating one script as follows

find $HOME -mount -size +1 \( ! \( -name *_Entry_*.xml.gz \) -name "*.gz" -o -name "*.Z" \) -mtime +1 -print |

becomes:

find $HOME -mount -size +1 \( ! \( -name *_Entry_*.xml.gz -o -name *_ECI_*.xml.gz \) -name "*.gz" -o -name "*.Z" \) -mtime +1 -print |

But it seems that the newer version does not work.

Could you pls help me and tell me what I'm doing wrong.

Thanks a lot
Cheers
Gnom
Reply With Quote
Forum Sponsor
  #2  
Old 04-28-2008
rubin's Avatar
Registered User
 

Join Date: Nov 2007
Posts: 216
You also need to quote the patterns inside the braces, especially when they contain wildcards, otherwise the command works fine:

Code:
find $HOME -mount -size +1 \(  !  \( -name "*_Entry_*.xml.gz" -o -name "*_ECI_*.xml.gz"  \) -name "*.gz" -o -name "*.Z"  \) -mtime +1 -print
Reply With Quote
  #3  
Old 04-28-2008
Registered User
 

Join Date: Feb 2008
Location: New Zealand
Posts: 44
Thank you very much rubin

Cheers
gnom
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 12:19 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