【问题标题】:How to pipe stdout/stderr to the stdin of another command in Turtle?如何将标准输出/标准错误通过管道传输到 Turtle 中另一个命令的标准输入?
【发布时间】:2017-07-31 19:54:46
【问题描述】:

标题几乎说明了一切,我在文档中找不到明显措辞的答案。我也不清楚如何将 stdout/stderr 保存在一个变量中,以便以后用于管道到 stdin 以获取多个命令。类似于下面的概念,x <- shell a b 表示从 shell 命令获取标准输出并将其存储在x


pipeThings = do
  c1out <- shell "some-cmd" empty
  ... do some things
  c1out `pipe` shell "another-cmd" empty
  c1out `pipe` shell "yet-another-cmd" empty

【问题讨论】:

    标签: haskell haskell-turtle


    【解决方案1】:

    你知道inshellWithErr的存在吗?

    【讨论】:

    • 这看起来可以完成这项工作。我四处寻找“管道”关键字,但没有找到任何东西。应该只是更广泛地搜索 stderr。
    猜你喜欢
    • 1970-01-01
    • 2022-07-05
    • 2020-11-02
    • 1970-01-01
    • 2013-06-25
    • 2021-04-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多