bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Small change in find


From: Taliver Heath
Subject: Small change in find
Date: Mon, 9 May 2005 13:09:42 -0400

I haven't read any of the bugs/requests/etc, so please forgive me if
this is a common request.  I have often thought that with the find
command, the semicolon should be optional on a -exec or -ok command
when it is the last command in the line.  For instance:

find /path -type f -exec ls -l '{}' 

Should be a legal command.  Going through the code, I found the
necessary place to make a change:


--- parser.c    2003-05-24 14:36:25.000000000 -0400
+++ parser.c.1  2005-05-09 13:06:49.000000000 -0400
@@ -1482,8 +1482,8 @@
        end++)
     if (strstr (argv[end], "{}"))
       num_paths++;
-  /* Fail if no command given or no semicolon found. */
-  if ((end == start) || (argv[end] == NULL))
+  /* Fail if no command given. */
+  if ((end == start) )
     {
       *arg_ptr = end;
       return (false);

I see that the original comment makes it very clear that the trailing
semicolon was desired, but I do not know why this was the case (error
checking, perhaps?)

Also, I would be interest in addressing the '{}'-syntax, and expanding
this to include the bash %,%%,#,## rules.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]