内容简介:翻译自:https://stackoverflow.com/questions/6073474/reading-input-from-a-system-command-in-haskell
命令后读取命令行标准,我知道有两个模块来执行系统命令:System.Cmd和System.Process
任何人都可以告诉我一个如何运行System.Process函数的简单示例?
这是我需要做的一个例子(我知道有System.Directory可以做到这一点,但我认为这是一个很好的例子):
>执行像ls -a这样的系统命令
>现在我不希望用户看到输出
>输出应该只能在我的程序中访问以验证它
我怎样才能做到这一点?
import System.Process test = readProcess "ls" ["-a"] ""
有关使用详情,请参阅 documentation .
翻译自:https://stackoverflow.com/questions/6073474/reading-input-from-a-system-command-in-haskell
以上所述就是小编给大家介绍的《从Haskell中的系统命令读取输入》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Programming Ruby
Dave Thomas、Chad Fowler、Andy Hunt / Pragmatic Bookshelf / 2004-10-8 / USD 44.95
Ruby is an increasingly popular, fully object-oriented dynamic programming language, hailed by many practitioners as the finest and most useful language available today. When Ruby first burst onto the......一起来看看 《Programming Ruby》 这本书的介绍吧!