Giter Site home page Giter Site logo

expect4j's Introduction

Expect4J

Overview

A powerful feature of Tcl has always been its integration with the Expect library (http://expect.nist.gov). As Tcl has been ported to the Java platform (http://tcljava.sourceforge.net/) certain C-based libraries have been left behind. Expect4j is an attempt to rewrite Expect in Java and provide bindings to the TclJava interpreter. The goal is to be able to port existing Tcl code bases that use Expect directly to Java without changes. The current version has successfully run a 10,000 line Tcl script which heavily depends on Expect for it operation.

Expect is the kitchen sink of IO control. It supports control of processes and sockets, and a complex method of match multiple patterns at the same time. These are needed in some applications, but it complicates the API a tad. Especially when it used in Java which doesn't support closures natively. There are other libraries which offer a more concise API, e.g. enchanter (http://code.google.com/p/enchanter/). enchanter is a very good library and it is highly recommended for automating ssh/telnet sessions. But when Expect syntax is needed, Expect4j is the way to go.

Excellent article on using expect4j: http://nikunjp.wordpress.com/2011/07/30/remote-ssh-using-jsch-with-expect4j/

Getting Started

Pre-requisites:

  • Maven 3

Build instructions:

#!/bin/bash

# Checkout the repository
git clone https://github.com/cverges/expect4j.git

# Change to the workspace
cd expect4j/

# Build everything via maven
mvn clean install

Questions?

Have questions about Expect4J? Please join our users group at https://groups.google.com/forum/#!forum/expect4j-users to ask your questions and get help from other Expect4J users.

Copyright and Licensing

Copyright © 2007 Justin Ryan
Copyright © 2013 Chris Verges <[email protected]>

Licensed under the terms of the Apache Public License v2.0.

expect4j's People

Contributors

cverges avatar cverges-se avatar gavin-scott avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.