Re: [tcljava-user] Expect support
Brought to you by:
mdejong
From: Chet V. <che...@gm...> - 2007-11-09 01:37:23
|
Thanks to everyone for responding. Justin, thanks for the links....the enchanter project looks interesting from our vantage point at first glance. It would be cool if its possible to integrate a Java scripting API to it.(jsr223) Regards, CV On Nov 8, 2007 5:59 PM, Mo DeJong <mo...@mo...> wrote: > > Justin Ryan wrote: > > In the Java space you have a few options for ssh/telnet scripting. The > > cleanest implementation I've seen is enchanter (1). While expectj (2) > > is more compliant with actual expect library. I learned this while > > investigating a expect solution for tcljava, and I also found that my > > best option was to just write one myself which supports not only > > expect in java but also the bindings needed for tcljava. The library > > is called expect4j: > > > > http://code.google.com/p/expect4j/ > > > > expect4j is aimed at supporting the functionality of the C-based > > expect library, started by Don Libes, in java and tcljava. The > > library is written in java and uses a bootstrap class called > > ExpectEmulation of load the relevant bindings into a tcljava Intrep. > > The most important tcl functions have been implement, e.g. expect, > > send, spawn. A full list of supported functions and global variables > > are commented in ExpectEmulation.java. I've successfully ported a > > 100K tcl script based on expect to tcljava, without any changes, by > > just using expect4j. > > > > One of the major limitations is that only ssh and telnet are supported > > by the spawn command. This was done to limit interactions with > > Runtime.exec(), and to keep the library completely in the java space. > > This avoids the need for process control, forking, and PTYs. On the > > otherhand, the Expect4j class can be used for automating any > > InputStream/OutputStream or Socket. One of the unit tests shows how > > to automate the "cmd /c net statistics Workstation" command on > > Windows. For support of ssh/telnet, Jsch is used for ssh and > > commons-net is used for telnet. The expect command can also match > > against many different regexps/strings, unlike the other expect-like > > libraries. ORO is used for the pattern matching. > > > > > > Hi Justin > > Thanks for posting this note, I did not know there was a useful expect > implementation out there > for Jacl. BTW, if you are looking for a home for the project, I really > have no problem with adding > your expect implementation to the standard Jacl distro. Jacl already has > Itcl bundled with it. > There are some issues that would need to be ironed out (license, regexp > impl, and so on) but it should work, > if you are interested. > > cheers > > Mo DeJong > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > tcljava-user mailing list > tcl...@li... > https://lists.sourceforge.net/lists/listinfo/tcljava-user > |