getting the exit code from a php script

Matthias Häker mhaeker at
Tue Sep 19 16:58:48 CEST 2006

Matthias Haeker schrieb
> but now i have always a  0 exitcode no 
> matter if the php script exit with 0 or 2 
> can anybody explain please 

I still cant explain it but i found a work around

if  X_FIELD1  or  X_FIELD2  X_FIELD3  is in  inside double
qoutes and contains no Whitespace i have always a  0
 exit code from php  , Why i dont know!!:)

but if i change my code to 

*  ? php  /script.php  \
  "$WS $X_FIELD1 $WS"  \
  "$WS $X_FIELD2 $WS"  \
  "$WS $X_FIELD3 $WS" 
 LOG = "$NL ======>  DATABASE UPDATE: \
 <====== $NL"  \

it will work , $WS contains a tab and a " "  / space:)

in my php script i trim the arguments with

$field1 = trim($argv[1]);
$field2 = trim($argv[2]);
$field3 = trim($argv[3]);

and i have it working now....

i still like to understand the WHY ????



More information about the procmail mailing list