Solved

how to fire a telnet command other than expect

Posted on 2014-03-20
6
721 Views
Last Modified: 2014-04-02
my telnet commands are:

1.  telnet localhost 6667  : this prompts a osgi promt

2.  osgi> bundle <number>

I need the output of the second command.
NOTE: It seems I dont have /usr/bin/expect on the server. It is a production server and i cannot install expect.
0
Comment
Question by:pvinodp
6 Comments
 
LVL 13

Accepted Solution

by:
Daniel Helgenberger earned 167 total points
ID: 39942931
NOTE: It seems I dont have /usr/bin/expect on the server. It is a production server and i cannot install expect.

The only way I know to script prompts is expect. You need it from the telnet client's side; so any client, not necessarily your server, will do.

However, if you do not need to login, this is worth a try:
telnet localhost 6667 << EOF
bundle <number>
EOF

Open in new window

0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 167 total points
ID: 39943085
Why don't you use a Java Telnet api?
0
 
LVL 13

Expert Comment

by:Daniel Helgenberger
ID: 39943178
Actually a very good idea; did not think about anything else but bash.

Though I would use something more common in Linux:, witch should work out of the box: Perl or Python. This way you can even overcome logins; but you nay still need libraries like net-telnet.
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 37

Assisted Solution

by:Gerwin Jansen
Gerwin Jansen earned 166 total points
ID: 39943642
You could also run use expect on your test or development server and connect to the production server using "telnet <production server> 6667". Do you have expect experience?
0
 

Author Comment

by:pvinodp
ID: 39944516
i cannot reach my production servers. And i do not know expect, but i can learn if needed.

Yes, my server can run java program and perl.

I found few articles on java and telnet. But as said already, that would need library. Which offcourse is not part of jdk. i found one with org.apache.commons.net.telnet.

Is it possible to write this in perl?
0
 

Author Closing Comment

by:pvinodp
ID: 39972012
I think expect is the way.. i am going with it.
I need to have expect installed no matter what library I use
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Protect jar file - windows app 2 38
Guacamole and browser performance 1 63
servlet  URL Rewriting 1 25
java stored proc example 9 20
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now