Enhance feedback of missing argument to -exec

Bug #1422453 reported by Karl-Philipp Richter
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
findutils (Ubuntu)
New
Undecided
Unassigned

Bug Description

Invoking a wrong `find` command, e.g. `find . -name pom.xml -exec grep '<repository>' {}+` causes the error message `find: missing argument to `-exec'` which could be more helpful if the error message would reflect the correct usage, e.g `find: missing argument to `-exec <arg> {}+'`.

ProblemType: Bug
DistroRelease: Ubuntu 14.10
Package: findutils 4.4.2-9
Uname: Linux 3.19.0-031900-generic x86_64
ApportVersion: 2.14.7-0ubuntu8.1
Architecture: amd64
CurrentDesktop: Unity
Date: Mon Feb 16 19:28:45 2015
Dependencies:
 gcc-4.9-base 4.9.1-16ubuntu6
 libc6 2.19-10ubuntu2.2
 libgcc1 1:4.9.1-16ubuntu6
 multiarch-support 2.19-10ubuntu2.2
EcryptfsInUse: Yes
InstallationDate: Installed on 2015-01-26 (20 days ago)
InstallationMedia: Ubuntu 14.10 "Utopic Unicorn" - Release amd64 (20141022.1)
SourcePackage: findutils
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Karl-Philipp Richter (krichter722) wrote :
Revision history for this message
Stefan Wagner (wagner-stefan) wrote :

Did you notice, that you need a blank before the plus sign?

$ find . -name pom.xml -exec grep '<repository>' {}+
$ find . -name pom.xml -exec grep '<repository>' {} +

For example, if find finds the files a/pom.xml and b/pom.xml, it will try to build the exec part as:

$ grep '<repository>' a/pom.xml b/pom.xml+

instead of

$ grep '<repository>' a/pom.xml b/pom.xml

leaving the + for find as special option.

Revision history for this message
Karl-Philipp Richter (krichter722) wrote :

Whatever is wrong, `find: missing argument to `-exec'` doesn't really help if `find` could just explain what's wrong.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.