文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Expect, cron & telnet - solved

Expect, cron & telnet - solved

时间:2007-07-02  来源:snowtty

  • From: Eric Sisler <esisler libris ci westminster co us>
  • To: redhat-list redhat com
  • Cc: Mark Enzinas <marke cyberplex com>
  • Subject: Expect, cron & telnet - solved
  • Date: Tue, 16 Feb 1999 09:26:11 -0700
Awhile back I inquired about a problem running an expect script from cron: >I'm starting to write expect scripts to automate >some system administration tasks and I have one >that works fine unless I try to schedule it using cron. >I know it's because I'm trying to spawn a telnet session >and telnet complains if it has no controlling tty - this >is the error message I get: > >failed to get controlling terminal using TIOCSCTTYparent: >sync byte write: broken pipe Turns out a simple & elegant solution to the problem is to schedule a short perl script with cron: #!/usr/bin/perl -w system("/usr/bin/expect /some/path/expectscriptname"); Cron runs the perl script and perl runs the expect script. I don't know enough about perl yet to really explain how it works, but apparently perl essentially has access to the command line, so running the expect script in this way is like running it interactively at the command line. Guess it's time to learn more about perl! So far I have successfully used this method with a set of bash & expect scripts that spawn telnet & ftp connections. A big thanks to Mark Enzinas <marke cyberplex com> for enlightening me. -Eric Eric Sisler Library Computer Technician Westminster Public Library Westminster, CO, USA esisler libris ci westminster co us Linux - don't fear the Penguin. 
相关阅读 更多 +
排行榜 更多 +
一剑灭天

一剑灭天

角色扮演 下载
戮仙战纪

戮仙战纪

角色扮演 下载
头号海贼王手机版

头号海贼王手机版

棋牌卡牌 下载