By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
462,162 Members | 801 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 462,162 IT Pros & Developers. It's quick & easy.

Net::Telnet - Handling unix commands

P: 2
Hi,

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!.

Thanks,
Aug 28 '07 #1
Share this Question
Share on Google+
3 Replies

KevinADC
Expert 2.5K+
P: 4,059
Have you tried setting the timeout? See the module documentation or details.
Aug 28 '07 #2

P: 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

KevinADC
Expert 2.5K+
P: 4,059
Since using "timeout" is the only way I know of to do what you want I have no other suggestions to offer.

-Kevin
Aug 28 '07 #4

Post your reply

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