This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(5)
我没有找到比避免通配符更好的东西
I haven't found anything better than just avoiding wildcard characters
@OP,我有一致的行为
您可能想尝试使用 findutils 而不是 UnxUtils。
@OP, i have consistent behaviour
You may want to try to use findutils instead of UnxUtils.
我已经找到了解决问题的方法。
find.exe
不适用于最新的 Windows 版本(Vista、7),因为它扩展了仅匹配当前目录内容的通配符。find.exe
正在运行。I have found myself the solution to my problem.
find.exe
is not working on recent Windows Versions (Vista, Seven) because it expands wildcards matching only the contents of the current directory.find.exe
from UnxUtils is working.一种解决方法是添加 Windows shell 不会扩展的通配符/扩展,但 GNU find 会扩展:
Windows shell[*] 不会解释/扩展方括号。此外,冒号在 Windows 文件名中不是有效字符,因此此模式无法匹配任何 Windows 文件名,并且 Windows shell 始终会将该模式传递给 find.exe。
然后,Find.exe 将查找以
.pdf
或:pdf
结尾的任何文件,但由于文件名不能以:pdf
结尾Windows,它只会查找以.pdf
结尾的文件。[*] 实际上是 C 运行时执行/不执行这些通配符扩展。我对 Win32 C 运行时的了解还不够深入,无法细化这种区别,所以现在为了解决这个问题,我只是说“shell”。
One workaround is to add a wildcard/expansion that the Windows shell does not expand, but GNU find does:
The Windows shell[*] does not interpret/expand square braces. In addition, colon is not a valid character in Windows filenames, so this pattern cannot match any Windows filename, and the Windows shell will always pass the pattern through to find.exe.
Find.exe will then find any files ending in
.pdf
or:pdf
, but since no files can have a name ending in:pdf
under Windows, it will only find files ending in.pdf
.[*] It's actually the C runtime that does/not perform these wildcard expansions. I don't understand the Win32 C runtime well enough to refine the distinction, so for now for the purpose of this workaround, I'm just saying 'shell'.
今天下午我就遇到了这个问题。
Benoit 的 UnxUtils 可以工作。
我还发现MinGW的find.exe可以工作,它在我的下面
目录。而且和说明书是一致的。
I suffered this problem this afternoon.
Benoit's UnxUtils can work.
I also find MinGW's find.exe can work,it is under my
directory. And it is consistent with the manual.