URL:
<http://savannah.gnu.org/bugs/?26217>
Summary: argument parsing bug with -regex
Project: findutils
Submitted by: None
Submitted on: Fri 17 Apr 2009 09:07:10 PM UTC
Category: find
Severity: 3 - Normal
Item Group: Wrong result
Status: None
Privacy: Public
Assigned to: None
Originator Name: dan pritts
Originator Email: [email protected]
Open/Closed: Open
Discussion Lock: Any
Release: 4.4.0
Fixed Release: None
_______________________________________________________
Details:
Apologies if this is some sort of stupidity on my part but I've poked at this
and read the docs a bunch.
my os is RHEL5, 32-bit x86. I've built my own findutils 4.4.0 to confirm
it's not just in RHEL's find.
Consider these two commands; they should be the same other than the final
line.
/home/danno/src/findutils-4.4.0/find/find $OLDDBROOTDIR \
-regextype posix-extended \
-maxdepth 1 \
-type d \
-regex "${OLDDBROOTDIR}/dbroot-[0-9]{8}-[0-9]{6}" \
-mtime +${num_days} \
-exec /bin/ls {} \;
/home/danno/src/findutils-4.4.0/find/find $OLDDBROOTDIR \
-regextype posix-extended \
-maxdepth 1 \
-type d \
-regex "${OLDDBROOTDIR}/dbroot-[0-9]{8}-[0-9]{6}" \
-mtime +${num_days} \
-ls \;
Here's what I get when i execute the script that contins them:
exec /bin/ls:
+ /home/danno/src/findutils-4.4.0/find/find /home/mysql/olddbroots -regextype
posix-extended -maxdepth 1 -type d -regex
'/home/mysql/olddbroots/dbroot-[0-9]{8}-[0-9]{6}' -mtime +20 -exec /bin/ls
'{}' ';'
[empty result is expected]
find -ls:
+ /home/danno/src/findutils-4.4.0/find/find /home/mysql/olddbroots -regextype
posix-extended -maxdepth 1 -type d -regex
'/home/mysql/olddbroots/dbroot-[0-9]{8}-[0-9]{6}' -mtime +20 -ls ';'
/home/danno/src/findutils-4.4.0/find/find: paths must precede expression: ;
Usage: /home/danno/src/findutils-4.4.0/find/find [-H] [-L] [-P] [-Olevel] [-D
help|tree|search|stat|rates|opt|exec] [path...] [expression]
[error message is not expected]
in general, if i give -exec, the command succeeds; if i try -print or -ls or
just leave it out, it fails.
The directory i'm specifying (/home/mysql/olddbroots) does exist.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?26217>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/