Monks
I am working on writing a Perl wrapper around the command line control utilities of a server. It is a log in "shell" essentially, so you start it with some basic information such as host and port and it provides you with a prompt, as so:
> {0}:
What I need to do now is send command in to this prompt sequentially, and potentially conditionally depending on logic in my wrapper. E.g. if I want to send the commands "start" and then "exit", thus if I typed it the prompt would look as follows:
> {0}: start
> {1}: exit
Is there any way in Perl I can achieve this, i.e. mimick manual input on stdin. If there is a way that uses only very core perl modules/core functionality that would be preferable as we only have a relatively basic installation of Perl and I cannot install new modules, but any help would be greatly appreciated.
Kind regards,
In reply to Interacting With A Program Over Stdin/Exec by arunhorne
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |