当我与grep一起做LS时,结果是我需要的内容:DLL的列表,请参见下文:

$ ls -R | grep "dll$"
boost_chrono-vc90-gd-1_47.dll
boost_chrono-vc90-mt-gd-1_47.dll
boost_chrono-vc90-1_47.dll
boost_chrono-vc90-mt-1_47.dll
boost_date_time-vc90-gd-1_47.dll
boost_date_time-vc90-mt-gd-1_47.dll
boost_date_time-vc90-1_47.dll
boost_date_time-vc90-mt-1_47.dll
boost_filesystem-vc90-gd-1_47.dll
boost_filesystem-vc90-mt-gd-1_47.dll
boost_filesystem-vc90-1_47.dll
...

但是,当我尝试将所有这些DLL复制到目的地说话../时,我遇到了错误,没有复制文件:

$ cp `ls -R | grep "dll$"` ../
cp: cannot stat `boost_chrono-vc90-gd-1_47.dll': No such file or directory
cp: cannot stat `boost_chrono-vc90-mt-gd-1_47.dll': No such file or directory
cp: cannot stat `boost_chrono-vc90-1_47.dll': No such file or directory
cp: cannot stat `boost_chrono-vc90-mt-1_47.dll': No such file or directory
cp: cannot stat `boost_date_time-vc90-gd-1_47.dll': No such file or directory
cp: cannot stat `boost_date_time-vc90-mt-gd-1_47.dll': No such file or directory
cp: cannot stat `boost_date_time-vc90-1_47.dll': No such file or directory
cp: cannot stat `boost_date_time-vc90-mt-1_47.dll': No such file or directory
cp: cannot stat `boost_filesystem-vc90-gd-1_47.dll': No such file or directory
cp: cannot stat `boost_filesystem-vc90-mt-gd-1_47.dll': No such file or directory
...

我曾经使用Cygwin来实现以前的Boost Build,但我不知道为什么现在它不适用于Boost Build 1-47。

感谢任何输入。

有帮助吗?

解决方案

您会看到DLL的列表,但您不知道它们居住的目录。目录名称一次打印在单独的行上,并通过 grep.

您不能使用 ls -R 对于任何有意义的事情。输出格式太友好了。利用 find 反而。这个命令

find . -name "*.dll"

将打印DLL的完整路径名(无需使用 grep)。这个命令

find . -name "*.dll" -exec cp {} ..

将把文件复制到 .. 而不是打印他们的名字。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top