how to start a new process while the other ist running on

Erik Geiger Erik.geiger at gmx.de
Wed Dec 22 21:47:35 CET 2004


Donn Cave schrieb:

> In article <cqbh6m$ttc$1 at online.de>, Erik Geiger <Erik.geiger at gmx.de>
> wrote:
[...]
> > Thats what I've tried, but it did not work. Maybe it's because I want to
> > start something like su -c '/path/to/skript $parameter1 $parameter2' 
> > user

> Unfortunately this particular case kind of dilutes the advantages
> of spawnv.  In the common case, parameter1 et al. would be submitted
> directly as the parameter list.  I believe it may be clearer to start
> with to think about the spawnv() function -
>    os.spawnv(os.P_NOWAIT, path, [cmdname, parameter1, parameter2])
> 
> If one of the parameters is itself another command, then of course
> it has to be rendered as a string
>    os.spawnv(os.P_NOWAIT, '/bin/su', ['su', '-c', '%s %s %s' % (cmd,
>       parameter1, parameter2)])
> so you have almost as much work to scan the parameters for shell
> metacharacters as you would have with system().
> 
>    Donn Cave, donn at u.washington.edu
OK, thats too high for me ;-)

Is the %s the variable for the following commands/parameters? If I have
three parameters, I'll need one more %s? Where to write the user for the su
command?

Well, I've given up ;-)

Thanks for the explanation!

Erik
-- 
Jemanden wie ein rohes Ei zu behandeln kann auch bedeuten, ihn in die Pfanne
zu hauen.



More information about the Python-list mailing list