[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug in find?
Re: bug in find?
Fri, 24 Oct 2014 15:19:09 -0600
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0
On 10/24/2014 12:57 PM, Jan Meyer wrote:
> */xxx $ find /media/jm/Windows -name *.rar*find: paths must precede
> expression: logport.rar
Not a bug in find, but in your usage pattern. Try this in each
directory where you see different behavior:
echo find /media/jm/Windows -name *.rar
to see what command you are really executing. I'm betting that in the
directory where you had a failure, you had more than one *.rar file,
which resulted in an invalid command line for find; and in the directory
where it "worked" but could only find one name in subdirectories, it was
because the glob has already been expanded into that one name. Only in
a directory that had no rar files at all does the shell leave the glob
*.rar untouched for find to then be able and look for all possible rar
echo find /media/jm/Windows -name '*.rar'
to see the command line you WANTED to type, then finally try:
find /media/jm/Windows -name '*.rar'
to see it work. Remember, you want * globbing to be quoted so that the
shell doesn't expand it early, because find also does globbing.
> Do I get a prize? Or a reprimand? :)
Which do you prefer? :) You've made a classing quoting blunder, and
didn't find any problem in find itself.
By the way, your mail came through rather botched. It is very hard to
see what you typed vs. what your terminal was displaying, when you had
line wraps that munged lines together.
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
Description: OpenPGP digital signature