how to fire a telnet command other than expect

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.
pvinodpAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Daniel HelgenbergerConnect With a Mentor Commented:
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
 
CEHJConnect With a Mentor Commented:
Why don't you use a Java Telnet api?
0
 
Daniel HelgenbergerCommented:
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Gerwin Jansen, EE MVEConnect With a Mentor Topic Advisor Commented:
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
 
pvinodpAuthor Commented:
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
 
pvinodpAuthor Commented:
I think expect is the way.. i am going with it.
I need to have expect installed no matter what library I use
0
All Courses

From novice to tech pro — start learning today.