Page 1 of 1

Run program asynchronously

Posted: Tue Dec 15, 2009 5:43 am
by Pepuch
Hi,
Sorry for my English :) Since yesterday I have got problem with asynchronously running programs under Linux. Problems started when I tried to run command with && operator (without it everything is ok). Problem example:

Code: Select all

 
$out = -1;
$cmd = 'sleep 10 && echo "ok" 2>&1 &';
system($cmd, $out);
 
Problem is that command is running synchronously. Can anyone help me with it? What is wrong with it?

Re: Run program asynchronously

Posted: Tue Dec 15, 2009 1:24 pm
by Christopher
I think you want ";" rather than "&&".