bugfindutils - Bugs: bug #12999, find "-regex" doesn't...

 
 

bug #12999: find "-regex" doesn't honor "bounds"

Submitted by:  Alexander Skwar <askwar>
Submitted on:  Fri 06 May 2005 05:13:33 PM UTC  
 
Category: findSeverity: 3 - Normal
Item Group: Wrong resultStatus: Fixed
Privacy: PublicAssigned to: James Youngman <jay>
Originator Name: Alexander SkwarOpen/Closed: Closed
Release: 4.2.20Fixed Release: 4.2.21

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 07 Jun 2005 11:37:19 PM UTC, comment #3:

You can download a release of findutils in which this problem is
fixed from ftp://alpha.gnu.org/gnu/findutils.

The releases on alpha.gnu.org are for testing purposes, so please
take the time to download the release and verify that your
problem has been solved. Once the release has been sufficiently
tested, it can be uploaded to ftp.gnu.org for everybody to use it.

James Youngman <jay>
Project AdministratorIn charge of this item.
Mon 09 May 2005 07:45:27 PM UTC, comment #2:

This problem is fixed in the CVS code for findutils.
To resolve your problem, you could either wait for the
next official release of findutils, or check out a copy
of the code from the CVS repository for findutils.

James Youngman <jay>
Project AdministratorIn charge of this item.
Mon 09 May 2005 07:44:54 PM UTC, comment #1:

It turns out to be due to the fact that the regexp syntax was not correctly initialised. It is now set to RE_SYNTAX_POSIX_BASIC in find/parser.c, which means that intervals are provided:

$ ./find . -regex '.*fstype.o\{1\}' -print
./fstype.o

James Youngman <jay>
Project AdministratorIn charge of this item.
Fri 06 May 2005 05:13:33 PM UTC, original submission:

[19:01:24 alexander@server:~/tmp/muell/finde] $ ls -la
insgesamt 4
drwxr-xr-x 2 alexander alexander 116 3. Mai 16:24 .
drwxr-xr-x 8 alexander alexander 4096 3. Mai 16:16 ..
-rw-r--r-- 1 alexander alexander 0 3. Mai 16:21 ab0{3}cd
-rw-r--r-- 1 alexander alexander 0 3. Mai 16:16 ab12345cd
-rw-r--r-- 1 alexander alexander 0 3. Mai 16:16 ab1234cd
-rw-r--r-- 1 alexander alexander 0 3. Mai 16:16 ab123cd
-rw-r--r-- 1 alexander alexander 0 3. Mai 16:18 ab9cd
-rw-r--r-- 1 alexander alexander 0 3. Mai 16:19 ab_cd
-rw-r--r-- 1 alexander alexander 0 3. Mai 16:20 ab.cd
-rw-r--r-- 1 alexander alexander 0 3. Mai 16:24 FOab9cd

I'm trying to find all the files in this directory whose names are starting with "ab", ending with "cd" and have between 4 and 5 digits between them. One way to do this, would be the following regex:

ab[0-9]{4,5}cd

So I tried:

[19:04:49 alexander@server:~/tmp/muell/finde] $ find . -regex './ab[0-9]{4,5}cd'
[19:04:54 alexander@server:~/tmp/muell/finde] $ find . -regex './ab[0-9]\{4,5\}cd'
[19:04:57 alexander@server:~/tmp/muell/finde] $

The find man page states, that "basic" re should be supported. If so, then the RE is correct - testing it with grep shows, that it is indeed correct:

[19:08:12 alexander@server:~/tmp/muell/finde] $ find . | grep './ab[0-9]\{4,5\}cd'
./ab12345cd
./ab1234cd

Why are the bounds in the RE not honored?

Alexander Skwar <askwar>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 6 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Tue 07 Jun 2005 11:37:19 PM UTCjayOpen/ClosedOpen=>Closed
  Fixed ReleaseNone=>4.2.21
Mon 09 May 2005 07:44:54 PM UTCjayItem GroupNone=>Wrong result
  StatusNone=>Fixed
  Assigned toNone=>jay
Fri 06 May 2005 05:13:33 PM UTCaskwarCarbon-Copy-=>Added -unavailable-

Back to the top


Powered by Savane 3.1-cleanup1