擅长:python、mysql、java
<p>对于手册部分,您可能需要查看<a href="http://pexpect.sourceforge.net/pexpect.html" rel="nofollow noreferrer">pexpect</a>或windows <a href="http://sage.math.washington.edu/home/goreckc/sage/wexpect/" rel="nofollow noreferrer">wexpect</a>。它们允许您在交互条件下执行子流程并传递输入。</p>
<p>不过,你所做的大部分工作听起来在shell脚本中都能很好地工作。为了简单起见,可以在服务器端为服务器端操作生成一个shell脚本,然后在ssh语句中插入路径:</p>
<pre><code>ssh user@host "/path/to/script.sh"
</code></pre>