471,108 Members | 1,596 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,108 software developers and data experts.

Net::Telnet - Handling unix commands


I have a perl script which uses Net::Telnet module to open a telnet session with my unix boxes, and executes lot of commands on those boxes.

As this module is implemented, when 'cmd' is used, this module waits for the 'prompt' to decide whether the command is finished or not. Now in case the 'timeout' is reached before the 'prompt' appears, the module directly throws error (even if the command might actually be running on the remote unix box!).

Is there any fool proof method that this module understands that the command is actually completed. Something similar to using 'ssh -l <user> <host> <command>'

This would come-out only after the command finishes on the remote host!.

Aug 28 '07 #1
3 1930
4,059 Expert 2GB
Have you tried setting the timeout? See the module documentation or details.
Aug 28 '07 #2
Of course we can change the timeout, but then that needs to be done for every command.

In Telnet module, we totally depend upon the value of 'prompt'. I want a more generic way by which i can fire the commands without worrying about the prompts and timeout!
Aug 28 '07 #3
4,059 Expert 2GB
Since using "timeout" is the only way I know of to do what you want I have no other suggestions to offer.

Aug 28 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Pete Johansen | last post: by
1 post views Thread by kriz4321 | last post: by
1 post views Thread by jyohere | last post: by
2 posts views Thread by kriz4321 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.