File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes Running expect4j in an SSH environment Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply locked New topic
Author

Running expect4j in an SSH environment

Anthony Schmitt
Ranch Hand

Joined: Nov 17, 2009
Posts: 37
I'm trying to login to SSH normally, then send six digits to my server, get a response, run expect4j code that matches regex and responds.

My code is almost working, save for that fact that my six digits and following response are being processed by my later expect4j code, and I don't know why.

This is the last line that gets processed before it hands off:
expect.expect("\r\nDestination: ", loginClosure);


Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 5811
    
    5

Duplicate of http://www.coderanch.com/t/581899/sockets/java/Running-expect-SSH-environment

Locking.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Running expect4j in an SSH environment
 
Similar Threads
SSH port forwarding is not working
Invoking unix shell commands from java.
Closing SSH connection kill deamon
Can't connect to ssh server using jsch or sshtools -- OpenSSL misconfiguration or coding error?
Running expect4j in an SSH environment