Re: [Haskell-cafe] System.Process
Quoth David Roundy <droundy@darcs.net>: ... | My point was that which of these is correct entirely depends on what | your input is. It's often a huge (and security-bug-prone) chore to | escape all those shell characters, and so in many cases it's much | nicer to execute an external program direcly without invoking a | shell. That's true, and in the other cases - when you want the shell to process the command line - you should be able to invoke it. I'm not looking at the source code (nor even running my example, since I don't have ghc handy), but the basic difference is not "runCommand parses the arguments", but "runCommand [only] invokes the shell". If you want runProcess to invoke the shell: runProcess "/bin/sh" ["-c", commandLine] ... (... ought to be ["sh", "-c" commandLine], but the way I remember it ghc gratuitously prevents you from specifying argv 0.) Donn Cave, donn@avvanta.com [I just sifted this thread out of ca. 300 spams and stuff, so please pardon me if this has already been mentioned in another followup.]
participants (1)
-
Donn Cave