Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/jexpect.git
------------------------------------
* JExpect v1.0
* Copyright (C) 2000 by Dave Jarvis
* Documentation v1.0b
------------------------------------

JExpect allows a client to send information to a server via Telnet.
It's intention is to automate ASCII text-based communications between
a client and server, using a very simple command set.

The command set is given to the client via standard input.  The first
line must be of the form "HOSTNAME PORT", to tell the client where to
connect.  Each line thereafter must be a JExpect command, detailed in
the next section.

------------------------------------
* Command Set
------------------------------------

Command names are case-insensitive.

EXPECT <text>

Pauses JExpect until particular text has been read from the server.
The comparison is case-sensitive, found anywhere on the line (e.g.,
PassWord will match "PassWord:" as well as "Your PassWord, please", but
not "password:").  JExpect will not time out if the expected text
never arrives; it will wait indefinitely.

SEND <text>

Sends information to the host machine.  This is the default command, so
specifying "SEND" isn't absolutely required, although it makes scripts
easier to read (and is required if sending leading whitespace; trailing
whitespace is discarded).

QUIT

Ends the JExpect session, closing the connection between client and server.

------------------------------------
* Example Session
------------------------------------

The following example remotely logs into a shell (via Telnet), executes
a command, then closes the connection.

  java ca.dj.jexpect.JExpect
  localhost 23  
  expect login
  send username
  expect password
  send userpass
  expect $
  who | grep username >> /tmp/somefile.log
  expect $
  quit

Note the final "expect $" before the "quit" command.  This makes sure
that the command fully executes, presuming the shell prompt contains
a "$" symbol somewhere on the line.

------------------------------------
* Copyright
------------------------------------
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to:

  The Free Software Foundation, Inc.,
  59 Temple Place - Suite 330
  Boston, MA 02111-1307
  USA

-fin-