'find' command inconsistency

shell scripts

Login to Reply

Thread Tools Search this Thread
# 1  
Old 06-11-2010
'find' command inconsistency

I am seeing a strange behavior of the 'find' command on AIX. As you can see,
the find command sometimes finds the file and sometimes does not based on how
many characters I specified between the wildcards.

I know all of these issues
can be resolved by using double quotes like "*est*". But I am posting this to
see if any of you can explain why it is able to find the file when I
specified *estf* but could not when I used *est*.

/home/testuser>uname -a

AIX myhost 3 5 00080B19D600

/home/testuser>ls -al /tmp/testuser

-rw-r--r--    1 testuser   staff             0 Jun 09 17:29 testfile

/home/testuser>find /tmp/testuser -name *est*

/home/testuser>find /tmp/testuser -name *estf*

# 2  
Old 06-12-2010

Rerun both commands, but with echo in front of each one ... cheers, drl
# 3  
Old 06-12-2010
The find util has co-dependency issues and likes its globbed args to be held...preferably between double-quotes.

Seriously, it does not always behave as expected on globbed -name args. You'll want to make sure and wrap your args in proper quotes to ensure that find can parse them properly.
find /tmp/testuser -name *est*   -o -name *estf* 
# versus ... 
find /tmp/testuser -name "*est*" -o -name "*estf*"

# 4  
Old 06-12-2010
The find command has no inconsistencies. If you don't quote parameters containing wildcards, they will be expanded before being passed to the find command if they match some existing filename. This is certainly true with your case.
As drl already wrote: echo will show you the root cause and demonstrate find isn't the issue here.
Login to Reply

Thread Tools Search this Thread
Search this Thread:
Advanced Search

Similar Threads More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Inconsistency with parallel run arunkumar_mca Linux 7 11-06-2017 01:16 PM
Svccfg listprop, inconsistency in service property javanoob Solaris 0 03-30-2016 06:12 AM
VCS Crashing due to inconsistency in opt (managed by VxvM) aji1729 Solaris 1 05-10-2012 02:22 PM
file system inconsistency venikathir Red Hat 3 11-24-2011 08:53 AM
How to use grep & find command to find references to a particular file Gangam Shell Programming and Scripting 2 09-22-2011 04:52 AM
Inconsistency between passwd and group Norgaard UNIX for Dummies Questions & Answers 1 07-01-2011 11:09 AM
Simplified find command to find multiple file types vickramshetty Linux 2 05-28-2010 02:28 PM
Variable value inconsistency on BASH and CSH pavanlimo Shell Programming and Scripting 2 04-08-2009 12:48 PM
File System inconsistency callitdctr UNIX for Dummies Questions & Answers 3 04-03-2009 04:22 AM
how to find a file named vijay in a directory using find command amirthraj_12 UNIX for Dummies Questions & Answers 6 10-25-2008 01:37 PM
Backspace stty inconsistency Runrig HP-UX 1 06-30-2008 10:40 AM
packet inconsistency problem clalfa Ubuntu 1 03-17-2008 05:53 PM
Little bit weired : Find files in UNIX w/o using find or where command jatin.jain Shell Programming and Scripting 10 09-19-2007 07:47 AM
Disk inconsistency Carmen123 UNIX for Dummies Questions & Answers 1 11-20-2006 11:10 AM
command find returned bash: /usr/bin/find: Argument list too long yacsil Shell Programming and Scripting 1 12-15-2003 06:38 PM
All times are GMT -4. The time now is 04:16 PM.

Unix & Linux Forums Content Copyright 1993-2018. All Rights Reserved.
Show Password

Not a Forum Member?
Forgot Password?