【问题标题】:How to run command using output of another command in DOS?如何在 DOS 中使用另一个命令的输出来运行命令?
【发布时间】:2009-09-25 21:12:33
【问题描述】:

例子:

for /? | if (this stream has word "the" in it) {echo the line with "the"}

我需要以某种方式分析重定向流中的文本。

【问题讨论】:

    标签: scripting command dos if-statement


    【解决方案1】:

    http://www.febooti.com/products/command-line-email/batch-files/ms-dos-command-redirection.html

    该网站提供了有关您可以在 DOS 中执行的不同类型管道的详细信息。

    【讨论】:

      【解决方案2】:

      使用竖线,使用竖线“|”。

      例如:

      for 的输出到 find

      for /? | find "the"
      

      输出的前几行:

        command    Specifies the command to carry out for each file.
                   Specifies parameters or switches for the specified command.
      To use the FOR command in a batch program, specify %%variable instead
      If Command Extensions are enabled, the following additional
      forms of the FOR command are supported:
          If set contains wildcards, then specifies to match against directory
      

      【讨论】:

        猜你喜欢
        • 2015-08-18
        • 1970-01-01
        • 2011-08-21
        • 2022-01-24
        • 1970-01-01
        • 1970-01-01
        • 2020-06-12
        • 2012-06-16
        • 1970-01-01
        相关资源
        最近更新 更多