Donn Cave schrieb: > In article <[EMAIL PROTECTED]>, Erik Geiger <[EMAIL PROTECTED]> > 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, [EMAIL PROTECTED] 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. -- http://mail.python.org/mailman/listinfo/python-list