Execute Shell-Script in the background

hey guys..

i wanna start the text.cgi within the php document by a button.. this works fine


<form action="cgi-bin/text.cgi">
<input type="submit" value="hit me">
</form>

-----------------------------------------------------

in the cgi-file i want to execute some shell commands.. the problem of the start.sh is, that the process runs in the front and i dont arrive the "return(0)" command.. i wanna reach, that i close the cgi script after starting the shell script and go further on the php site..(running the shell-file in the background didn't help yet -

thanks in advance for some help :)

int main(void)
{
printf("Content-Type: text/html; charset=iso-8859-1\n\n");
system("rm -r /mjpg-streamer/pics/* && /mjpg-streamer/start.sh");
return 0;
}


mfg mlgRs
You need CreateProcess() equivalent fot *nix operating systems, which can spawn a new process asincronously (don't know what API to use, sorry).
fork() (mitosis) and exec() family (ditto)
Topic archived. No new replies allowed.