Thanks again for your detailed reply
I have made clear in my mind that bash intervenes only to do the globbing and that if no globbing is required, it passes the arguments to locate.
Bash compares strings with unquoted pattern matching characters against the names of files in the current working directory. As David the H. correctly pointed out, Bash also obeys any relative paths you specify like ./subdir/ or ../otherdir/ when matching the pattern.
Code:
~/foo$ mkdir bar
~/foo$ touch bar/one bar/two bar/three
~/foo$ ls bar
one three two
~/foo$ echo bar/*e*
bar/one bar/three
I presume this is what should happen and indeed, when giving e.g
Code:
ioannis@ioannis-laptop:~/Music$ locate *th* | wc -l
17
I get the expected result
I can't really say because I don't know your system. My best guess is that no files in your current working directory match the pattern, so locate receives the argument *te*.
No , it cant be the case because I didnt change anything .Something really strange ins going on .I tried to add dir kate in my home dir to see if your assumption is right and.. :
Code:
ioannis@ioannis-laptop:~$ mkdir kate
ioannis@ioannis-laptop:~$ sudo updatedb
ioannis@ioannis-laptop:~$ locate *te* | wc -l
391
ioannis@ioannis-laptop:~$ rm -r kate
ioannis@ioannis-laptop:~$ sudo updatedb
ioannis@ioannis-laptop:~$ locate *te* | wc -l
29
29 again ! hurahh ! and before removing kate 391 !
And only about the half belong to my home dir :
Code:
ioannis@ioannis-laptop:~$ locate *te* | tail -2
/usr/share/librarian/Templates/C
/usr/share/librarian/Templates/C/scrollkeeper_cl.xml
I suppose it is also conceivable that your system is configured somewhat differently with regards to locate and/or shell options. I can't even guess what those differences might be. In such a case you will have to review the appropriate documentation and configuration files with great intensity to discover the cause. I very much doubt this is the case though.[/QUOTE]
I have a clean installation of Ubuntu 10.10 64 bit and have touched nothing related to configurations of bash .
I suspect that a bug is whats going on here