开发者

writing pexpect like program in c++ on Linux

开发者 https://www.devze.com 2022-12-15 07:14 出处:网络
Is there any way of writing pexpect like small program which can launch a process and pass 开发者_C百科the password to that process?

Is there any way of writing pexpect like small program which can launch a process and pass 开发者_C百科the password to that process? I don't want to install and use pexpect python library but want to know the logic behind it so that using linux system apis I can build something similar.


You could just use "expect". It is very light weight and is made to do what youre describing.


For very simple cases, empty is one option. It's a lightweight C program, and it can be used straight from a shell script and doesn't require Tcl.

For Debian/Ubuntu, the package is empty-expect.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号