Cat Aa.txt | grep ' startup ' |wc-l is not a problem to test under the Linux command line. But there's a problem with the exec in PHP, it's weird. Result Error: Error prompt as follows: Cat:write Error:broken pipe waste a good big strength, check a lot of information, finally solved. The option to add the-a option to grep is OK with the grep-a option meaning: Process a binary file as if it were text; This was equivalent to the--binary-files=text option should be cat's this file content has a binary stream that causes grep to not recognize
http://www.bkjia.com/PHPjc/477649.html www.bkjia.com true http://www.bkjia.com/PHPjc/477649.html techarticle Cat Aa.txt | grep startup |wc-l There is no problem testing under the Linux command line. But there's a problem with the exec in PHP, it's weird. Result Error: Error prompt as follows: Cat:write Erro ...