Phpexec () a shell result error occurs because grep in php can only process text streams, but binary streams cannot.

Source: Internet
Author: User
Cataa.txt | grep & amp; #39; startup & amp; #39; | wc-l can be tested in the linux command line. But the exec in php has a problem, which is strange. Result: the error message "cat: writeerror: Brokenpipe" indicates that the cat: writeerror is useless... "/> <script cat aa.txt | grep 'startup' | wc-l is available in linux command lines. But the exec in php has a problem, which is strange. Result: the following error message is displayed: cat: write error: Broken pipe has been exhausted. after checking a lot of information, the solution is finally solved. When the-a option is added to the grep option, the grep-a option indicates that Process a binary file as if it were text; this is equivalent to the -- binary-files = text option should be cat. the content of this file has a binary stream, causing grep to not recognize

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.