PHP: what's wrong with this line (shell_exec, find, xargs, grep)?
The commands below only return any output, if the total length of filenames returned by the find command and piped to the grep command is less then cca. 50kB:
$strCmd = 'find ' . $mappa . ' -name "' . $strFilename . '" -type f -print | xargs grep -l -i -E "' . $strText . '"' ;
$strList = shell_exec($strCmd)
Sorry, it turned out that the problem is caused by a subsequent command, which is:
$strCmd1 = 'echo ' . $strList . ' | xargs grep -l -i -E "' . strText1 . '"'
The problem is, I think, that $strList may contain too long data to be passed to echo as argument.
But, if I cannot use echo, how to pass the value of $strList to grep???
Last edited by J_Szucs; 11-18-2003 at 11:51 PM.