【发布时间】:2012-12-31 14:10:00
【问题描述】:
例如一个最小的脚本:
#!/usr/bin/php
<?php
# do some stuff and then drop into another interactive script:
system('something.sh');
'something' 可以是 bash、二进制等,并且是交互式的,例如 sql/telnet/等。在 bash 中,这是微不足道的。这甚至可能在php内部吗?
我试过 system()、exec()、passthru()、shell_exec()
proc_open() 看起来可行,但设置起来很麻烦。
【问题讨论】:
标签: php shell command-line-interface interactive