开发者

Reading input from a system command in Haskell

hi I need to read the command line standard out after executing a haskell command, i know there are two modules to execute system commands: System.Cmd and System.Process

can anybody show me a simple example how to run the System.Process functions?

here is a example what i need to do (i know there is System.Directory to do that but i thought this is a good example):

  1. execute a system co开发者_如何学Pythonmmand like ls -a
  2. now i dont want the user to see the output
  3. the output should only be accessable in my program to validate it

how can i do that?


import System.Process
test = readProcess "ls" ["-a"] ""

Do refer to the documentation for usage details.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜