“Varible syntax” problem cause the shell can't return the value properly.
#!/bin/csh set php_path = '/usr/bin/php' $php_path test.php $argv exit $?
when you run this shell
system("test > test.log", $ret);
the $ret is always 1, and run the real shell, there is varible syntax at the last. and it cause the the $ret value is always 1, And find if the shelll is C-shell, the return value capture return should be "$status" not "$?", after update the script, everything works fine
#!/bin/csh set php_path = '/usr/bin/php' $php_path test.php $argv exit $status