Re: Can anyone write an expect script for me?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: Can anyone write an expect script for me?

From: Adrian Ho <tcl@03s.net>
Date: Mon Dec 19 2005 - 11:07:38 CET

On 2005-12-19, zelzel.zsu@gmail.com <zelzel.zsu@gmail.com> wrote:
> Hi, Can anyone write an expect script for me?
>
> I was trying to chech the iptables rules.
> For some reason, i have to change to root to run iptablles -L.
>
> I want to check it frequently,
> So, i want an expect script, to fill the root password automaticly.
> [I've tried, but failed.]

http://wiki.tcl.tk/11583 has a example that's pretty close, along with
other Expect examples that you may find useful, but if you're willing
to consider alternative solutions, I'd recommend using the "sudo"
command instead. "man sudo" for details -- it should already be
available on your (BSD-based?) system.

ObTcl: Tcl's a great Swiss army knife, and you could use it to cut
grass, but if you already have a lawnmower, why bother? 8-)

Regards,
Adrian
Received on Fri Dec 23 19:02:05 2005