How can I screen-scrape output from telnet in Perl?

后端 未结 6 416
死守一世寂寞
死守一世寂寞 2021-01-18 00:13

I can setup a telnet connection in Perl no problems, and have just discovered Curses, and am wondering if I can use the two together to scrape the output from the telnet ses

6条回答
  •  佛祖请我去吃肉
    2021-01-18 00:27

    Or you could use the script command for this.

    From the Solaris man-page:

    DESCRIPTION

    The script utility makes a record of everything printed on your screen. The record is written to filename. If no file name is given, the record is saved in the file typescript...

    The script command forks and creates a sub-shell, according to the value of $SHELL, and records the text from this session. The script ends when the forked shell exits or when Control-d is typed.

提交回复
热议问题