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

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

P: 4
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.  
Oct 18 '07 #1
Share this Question
Share on Google+
4 Replies


P: 4
Any body know?
Please help me.
Thanks.
Oct 19 '07 #2

numberwhun
Expert Mod 2.5K+
P: 3,503
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
Oct 19 '07 #3

P: 4
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.
Oct 19 '07 #4

numberwhun
Expert Mod 2.5K+
P: 3,503
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
Oct 19 '07 #5

Post your reply

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