The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Special Forums > Windows & DOS: Issues & Discussions
.
google unix.com



Windows & DOS: Issues & Discussions All Windows and DOS questions should go here as well. Discuss UNIX to Windows (Desktop or Server) here!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Need Help on "waitfor" command in net::Telnet Module sudhakaryadav Shell Programming and Scripting 1 01-23-2009 10:36 AM
Problem scheduling perl script with "at" command squallsquall Shell Programming and Scripting 6 01-09-2009 04:39 AM
The "PS" command was displaying*terminals named as "SYSCON" kiranjose85 UNIX for Advanced & Expert Users 1 11-28-2008 07:53 AM
Unix "at" / "Cron" Command New Problem...Need help Mohanraj UNIX for Dummies Questions & Answers 3 01-26-2006 08:08 PM
Help! "Put" command from telnet session tigote UNIX for Dummies Questions & Answers 5 12-27-2001 04:39 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-27-2009
sudhakaryadav sudhakaryadav is offline
Registered User
  
 

Join Date: Jan 2009
Posts: 21
Need Help on "waitfor" command in net::Telnet Module in PERL

Hi,
Can anybody help me in writing command "waitfor" for string
"C:\WINNT\Profiles\mfcf0508>" while using net::Telnet module.
I tried the below format :

$telnet->waitfor('/"C\:\WINNT\Profiles\mfcf0508>".*$/i');
Getting error as : pattern match timed-out
Plz help me
  #2 (permalink)  
Old 01-27-2009
Corona688 Corona688 is offline
Registered User
  
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 1,933
Quote:
Originally Posted by sudhakaryadav View Post
Hi,
Can anybody help me in writing command "waitfor" for string
"C:\WINNT\Profiles\mfcf0508>" while using net::Telnet module.
I tried the below format :

$telnet->waitfor('/"C\:\WINNT\Profiles\mfcf0508>".*$/i');
Getting error as : pattern match timed-out
Plz help me
Try doubling up the backslashes, Perl may be interpreting them as (bad) escape sequences. Also, you've got a c\:\ there, perhaps you meant c:? And are the double-quotes really necessary?
  #3 (permalink)  
Old 01-29-2009
sudhakaryadav sudhakaryadav is offline
Registered User
  
 

Join Date: Jan 2009
Posts: 21
Tried by putting double back slashes and removing double quotes .
Still iam getting "pattern match timed-out at ./bsc.pl line 20" error.

$telnet->waitfor('/C:\\WINNT\\Profiles\\mfcf0508\\>.*$/i');

original string : C:\WINNT\Profiles\mfcf0508>
  #4 (permalink)  
Old 01-29-2009
Corona688 Corona688 is offline
Registered User
  
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 1,933
Quote:
Originally Posted by sudhakaryadav View Post
Tried by putting double back slashes and removing double quotes .
Still iam getting "pattern match timed-out at ./bsc.pl line 20" error.

$telnet->waitfor('/C:\\WINNT\\Profiles\\mfcf0508\\>.*$/i');
What is the .*$ there for? It seems superfluous unless you really need to match the entire line. For that matter, does it even need to be a regex? waitfor is supposedly capable of waiting for simple strings. $telnet->waitfor("C:\\WINNT\\Profiles\\mfcf0508\\>");

What I often do when debugging regexes is simplify them greatly, then add more to the end until they stop working. See if you can get it to match "c:\\", then add more until you find the point it breaks at.

$telnet->dump_log(); may also be useful should the remote server turn out to not be sending precisely what you think it is.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:02 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0