擅长:python、mysql、java
<p>例如,您的操作系统限制:</p>
<pre><code>>>> import os
>>> os.execl('/bin/ls', 'ls', 'c'*10**7)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/os.py", line 314, in execl
execv(file, args)
OSError: [Errno 7] Argument list too long
</code></pre>
<p>是否有必要在命令行上传递数据(您是否可以使用管道/文件/套接字等)对你来说呢?你能用分开的命令行参数多次运行这个命令吗?见<a href="https://unix.stackexchange.com/q/128559/1321">Solving “mv: Argument list too long”</a>。在</p>
<p>如果传递的环境太大,则可能会出现相同的错误:</p>
^{pr2}$
<p>解决方案是清理传递的环境,以避免未使用的大型环境变量。在</p>
<p><a href="https://unix.stackexchange.com/a/210870/1321">The limits might be hardcoded in the kernel source</a>。在</p>