"find" command throws nonsense error message
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
findutils (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Steps to reproduce:
1. Run this command from a terminal:
$ find . -name *.txt
Expected result:
It should list all the files found in the current directory or any descendant directory whose name ends in ".txt". It may or may not find matching files, depending on whether there are or there aren't.
If there's something wrong in my command, then it should ALWAYS consistently issue a sensible error message explaining what's wrong with my command, and that should happen regardless of the contents of the current directory.
Observed results:
If there are no .txt files to be found, it behaves as expected (i.e., no results, no error message).
If there are files ending in .txt, sometimes it behaves as expected, showing the results.
If, however, there are files ending in ".txt" with dashes ("-") or spaces (" ") in the filename, AND there is more than one file that matches the criteria, then it displays this completely nonsensical error message:
````````````
find: paths must precede expression: XXXXXXXXXXXX.txt
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|
````````````
where "XXXXXXXXXXXXX.txt" is an actual filename of a matching file.
For example, this will reproduce the issue:
```````
$ echo "lalala" > aaa.txt
$ echo "lololo" > foo-bar.txt
$ find . -name *.txt
find: paths must precede expression: foo-bar.txt
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|
```````
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: linux-image-
ProcVersionSign
Uname: Linux 4.4.0-131-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.1-0ubuntu2.18
Architecture: amd64
AudioDevicesInUse:
USER PID ACCESS COMMAND
/dev/snd/
CurrentDesktop: Unity
Date: Sat Aug 11 17:30:54 2018
HibernationDevice: RESUME=
InstallationDate: Installed on 2013-10-11 (1764 days ago)
InstallationMedia: Ubuntu 13.04 "Raring Ringtail" - Release amd64 (20130424)
MachineType: Acer Aspire V3-571G
ProcFB: 0 inteldrmfb
ProcKernelCmdLine: BOOT_IMAGE=
RelatedPackageV
linux-
linux-
linux-firmware 1.157.20
SourcePackage: linux
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 10/15/2012
dmi.bios.vendor: Acer
dmi.bios.version: V2.07
dmi.board.
dmi.board.name: VA50_HC_CR
dmi.board.vendor: Acer
dmi.board.version: Type2 - Board Version
dmi.chassis.type: 10
dmi.chassis.vendor: Acer
dmi.chassis.
dmi.modalias: dmi:bvnAcer:
dmi.product.name: Aspire V3-571G
dmi.product.
dmi.sys.vendor: Acer
It's funny that when creating the bug report there was a choice for the package to report against:
- linux
- I don't know.
I chose "I don't know", but it has been assigned to linux allthesame. Brilliant.