以下命令有何作用:(某些命令)>文件1 文件2
我正在重写一个古老且相当破碎的构建,并遇到了一条包含我以前从未见过的东西的规则。它看起来像这样:
%_ui.cc:
${SOME_UTILITY} ${*}
sed '/\#include "${*}.h"/d' > tempstubs.cc ${*}_stubs.cc
/bin/csh -c 'if (-w ${*}_stubs.cc ) cp -f tempstubs.cc ${*}_stubs.cc'
-rm -f tempstubs.cc
sed 行就是我所指的那行。我从未见过像 > 之后有两个文件的重定向。
I'm re-writing an ancient and pretty broken build and ran across a rule with something in it I've never seen before. It looks like this:
%_ui.cc:
${SOME_UTILITY} ${*}
sed '/\#include "${*}.h"/d' > tempstubs.cc ${*}_stubs.cc
/bin/csh -c 'if (-w ${*}_stubs.cc ) cp -f tempstubs.cc ${*}_stubs.cc'
-rm -f tempstubs.cc
The sed line is the one I'm referring to. I've never seen a redirection like that with two files after the >.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没关系,想通了。 sed 行可以重写为:
... 并且在语义上似乎是相同的。
Nevermind, figured it out. The sed line could've been re-written as:
... and appears to be semantically identical.