Hi all,
I have a simple linux script , with the following code:
/////////////////////////////////////////////
grep ^$1 poppasswd | awk 'BEGIN { FS = "/" } { print $(NF-1) }'
/////////////////////////////////////////////
The script works fine when i execute it from the localhost.
When I execute it from PHP, i dont get any result. i use the following code:
///////////////////////////////////////////////////////////
if (!function_exists('imp_expand_fromaddress')) {
function imp_expand_fromaddress ($imp) {
$cmd = '/usr/local/bin/myscript ' . escapeShellCmd($imp['user']);
$res=exec("$cmd");
return ($res);
}
}
////////////////////////////////////////////////////////////
I think the problem is in the { print $(NF-1) }' in the linux script, because if i add a : echo "name" to the script, the function in PHP works and returns the value "name".
Any idea??
Thanks!


