Connecting Tech Pros Worldwide Help | Site Map

Windows Call Unxi Perl Script, then input data on Windows Console

Newbie
 
Join Date: Oct 2007
Posts: 4
#1: Oct 18 '07
Hello everybody:
I am having a problem.
On Unix platform, there is a script that need user to input data from console, then when I call Unix perl script from

Windows, these is an issue occurs, when I input data and enter "enter" so fast, the Windows console is freezed, I don't know

why, does anybody know?Thank you very much.

My code like follows:

On Windows:
Expand|Select|Wrap|Line Numbers
  1. $host = "192.168.18.242";
  2. system("rsh " . $host . " -l brcm01 /export/home/Script/WindowsCallUnixKeyDataTest.pl");
  3.  
On Unix:
Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2.  
  3. my $input = "";
  4.  
  5. $input = <STDIN>;
  6.  
  7. $input =~ s#\r##i; #filter character "\r"
  8.  
  9. chomp($input);
  10. while($input !~ /\q/i)
  11. {
  12.  
  13.     print "Now you input : $input\n";
  14.  
  15.     $input = <STDIN>;
  16.  
  17.     $input =~ s#\r##i;
  18.  
  19.     chomp($input);
  20. }
  21.  
Newbie
 
Join Date: Oct 2007
Posts: 4
#2: Oct 19 '07

re: Windows Call Unxi Perl Script, then input data on Windows Console


Any body know?
Please help me.
Thanks.
numberwhun's Avatar
Site Moderator
 
Join Date: May 2007
Location: New Hampshire
Posts: 2,565
#3: Oct 19 '07

re: Windows Call Unxi Perl Script, then input data on Windows Console


Quote:

Originally Posted by jane007

Any body know?
Please help me.
Thanks.

Sorry, but the way you asked your question is really not that clearly worded.

Have you tried the rsh command from your Windows command line to see if you can get in an run the perl script?

If you do that, you will see that the script is waiting for input. The system command does not seem to supply that input, so the window appears to freeze because there is no input being supplied.

Regards,

Jeff
Newbie
 
Join Date: Oct 2007
Posts: 4
#4: Oct 19 '07

re: Windows Call Unxi Perl Script, then input data on Windows Console


Sorry, I means I use perl script on Windows, then remote call perl script on Unix which will ask me to input data.
I have tried it's ok of remoting call.
So, I don't know why I enter "enter" so fast, the screen console will be freezed, but when I input data, then enter "enter" slowly, there is no problem.
Could you try my script?
Thank you.
numberwhun's Avatar
Site Moderator
 
Join Date: May 2007
Location: New Hampshire
Posts: 2,565
#5: Oct 19 '07

re: Windows Call Unxi Perl Script, then input data on Windows Console


Quote:

Originally Posted by jane007

Sorry, I means I use perl script on Windows, then remote call perl script on Unix which will ask me to input data.
I have tried it's ok of remoting call.
So, I don't know why I enter "enter" so fast, the screen console will be freezed, but when I input data, then enter "enter" slowly, there is no problem.
Could you try my script?
Thank you.

Regardless of "where" you are executing the script from, it is still being done remotely. The script you seem to be executing is expecting input. Is the rest of your script supplying that input or is this all of it ( just a system function with an rsh command)? If this is all of it, then (as I said), the window appears to be freezing because it needs input.

Regards,

Jeff
Reply