The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 and shell scripting languages 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 10:41 AM
problem with find braindrain Shell Programming and Scripting 2 03-29-2006 12:33 PM
how to find Script file location inside script asami Shell Programming and Scripting 10 03-15-2006 12:57 AM
Problem with `find ...` Cameron Shell Programming and Scripting 4 08-10-2005 07:24 AM
Another Find Problem sethkor Shell Programming and Scripting 6 02-24-2005 07:56 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-27-2008
gnom gnom is offline
Registered User
  
 

Join Date: Feb 2008
Location: New Zealand
Posts: 66
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
  #2 (permalink)  
Old 04-28-2008
rubin's Avatar
rubin rubin is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2007
Posts: 321
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
  #3 (permalink)  
Old 04-28-2008
gnom gnom is offline
Registered User
  
 

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

Cheers
gnom
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 07:22 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0