Re: EMX runtime and command line arguments

Andreas Buening <[email protected]> Mon, 19 Jan 2004 13:20:17 +0100
Newsgroups gmane.comp.ide.emx.devel
Message-ID <[email protected]>
[email protected] wrote:
> 
> Andreas wrote:
> 
> > Sigh. Okay, I have an arbitrary string which is supposed to be a command
> > line for cmd. This line may contain arbitrary calls to arbitrary programs,
> > EMX as well as non-EMX programs, builtin commands and an arbitrary number
> > of special characters like &"'\%$;. The job has to be executed as a child
> > process, i.e., I have to use spawn*(). And, the command should be processed
> > as if the line had been entered on a cmd command line, and no quote or
> > backslash or whatever may (dis)appear magically.
> >
> > How can I do this?
> 
> system()

Not really. ;-)
The process must run asynchronously so I have to use spawn*().
If I use, e.g., 

char *argv[] = { "cmd", "/c", "arbitrary_string", NULL };
pid = spawnvp(P_NOWAIT, "cmd", argv);

isn't this identical to using

arbitrary_string

on the command line?


Bye,
Andreas