note 60212 deleted from language.operators.execution by salathe
| From: | salathe@php.net | Date: | Tue, 08 Oct 2019 18:30:57 +0000 |
| Subject: | note 60212 deleted from language.operators.execution by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-212558@lists.php.net to get a copy of this message | ||
Note Submitter: cs at kainaw dot com
----
After much trouble, I have concluded that the backtick operator (and shell_exec) have a limited
buffer for the return. My problem was that I was grepping a file with over 500,000 lines, receiving
a response with well over 100,000 lines. After a short pause, I was flooded with errors from grep
about the pipe being closed.
I have searched, but I cannot find the exact size of the buffer used by the backtick operator and
shell_exec. So, to avoid this error, you must limit the output of your commands (such as using -m
with grep). Through trial and error, you can get the command to run without error.