Re: [Haskell-cafe] System.Process

2008-09-30 Thread Svein Ove Aas
On Tue, Sep 30, 2008 at 2:32 AM, Timothy Goddard [EMAIL PROTECTED] wrote: On Tue, 30 Sep 2008 08:49:44 Andrew Coppin wrote: Before anybody remarks that words will do this, consider the echo command, which treats whitespace meaningfully.) [EMAIL PROTECTED]:~/$ echo foo barbaz foo

Re: [Haskell-cafe] System.Process

2008-09-30 Thread Ketil Malde
Svein Ove Aas [EMAIL PROTECTED] writes: All programs want argument arrays, not un-split lines, and if you don't have the shell split it you'll have to do it yourself. words works fine. ...as long as the words don't contain quotes, or wildcard/globbing characters, or $, ! and probably other

Re: [Haskell-cafe] System.Process

2008-09-30 Thread David Roundy
On Tue, Sep 30, 2008 at 10:14:38AM +0200, Ketil Malde wrote: Svein Ove Aas [EMAIL PROTECTED] writes: All programs want argument arrays, not un-split lines, and if you don't have the shell split it you'll have to do it yourself. words works fine. ...as long as the words don't contain

Re: [Haskell-cafe] System.Process

2008-09-30 Thread Jonathan Cast
On Tue, 2008-09-30 at 18:33 +0200, Ketil Malde wrote: David Roundy [EMAIL PROTECTED] writes: Actually, it's no problem having any of those characters in your arguments, My point is that using 'words' on the argument sting to 'runProcess' and expecting the same result as 'runCommand'

Re: [Haskell-cafe] System.Process

2008-09-30 Thread Jonathan Cast
On Tue, 2008-09-30 at 09:30 -0700, Jonathan Cast wrote: On Tue, 2008-09-30 at 18:33 +0200, Ketil Malde wrote: David Roundy [EMAIL PROTECTED] writes: Actually, it's no problem having any of those characters in your arguments, My point is that using 'words' on the argument sting to

Re: [Haskell-cafe] System.Process

2008-09-30 Thread David Roundy
On Tue, Sep 30, 2008 at 06:33:52PM +0200, Ketil Malde wrote: David Roundy [EMAIL PROTECTED] writes: Actually, it's no problem having any of those characters in your arguments, My point is that using 'words' on the argument sting to 'runProcess' and expecting the same result as

Re: [Haskell-cafe] System.Process

2008-09-30 Thread Ketil Malde
David Roundy [EMAIL PROTECTED] writes: Actually, it's no problem having any of those characters in your arguments, My point is that using 'words' on the argument sting to 'runProcess' and expecting the same result as 'runCommand' implies making those assumptions:: Prelude System.Process let

Re: [Haskell-cafe] System.Process

2008-09-30 Thread wman
how about using a wrapper script, to which you would supply the value as parameter so you would just use runCommand thescript envval rest of parameters ? Herein lies the problem: I have a program that accepts complete commands from a file and executes them. It works perfectly. And now I'd just

Re: [Haskell-cafe] System.Process

2008-09-30 Thread Donn Cave
Quoth David Roundy [EMAIL PROTECTED]: ... | 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

[Haskell-cafe] System.Process

2008-09-29 Thread Andrew Coppin
Much hair-pulling resulted today when I attempted to perform a small task. The System.Process module provides the runCommand function. This takes a complete command line and returns a ProcessHandle. No problem there. The module also provides the runProcess function, which enables you to set

Re: [Haskell-cafe] System.Process

2008-09-29 Thread Brandon S. Allbery KF8NH
On Sep 29, 2008, at 15:49 , Andrew Coppin wrote: Herein lies the problem: I have a program that accepts complete commands from a file and executes them. It works perfectly. And now I'd just like to set an environment variable while each command runs... But alas no, the only way to do that

Re: [Haskell-cafe] System.Process

2008-09-29 Thread Andrew Coppin
Brandon S. Allbery KF8NH wrote: On Sep 29, 2008, at 15:49 , Andrew Coppin wrote: Herein lies the problem: I have a program that accepts complete commands from a file and executes them. It works perfectly. And now I'd just like to set an environment variable while each command runs... But alas

Re: [Haskell-cafe] System.Process

2008-09-29 Thread Brandon S. Allbery KF8NH
On Sep 29, 2008, at 15:59 , Andrew Coppin wrote: Brandon S. Allbery KF8NH wrote: On Sep 29, 2008, at 15:49 , Andrew Coppin wrote: Herein lies the problem: I have a program that accepts complete commands from a file and executes them. It works perfectly. And now I'd just like to set an

Re: [Haskell-cafe] System.Process

2008-09-29 Thread Timothy Goddard
On Tue, 30 Sep 2008 08:49:44 Andrew Coppin wrote: Before anybody remarks that words will do this, consider the echo command, which treats whitespace meaningfully.) [EMAIL PROTECTED]:~/$ echo foo barbaz foo bar baz Echo doesn't receive special treatment. It joins its arguments with