473,696 Members | 1,886 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

4 New Member
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
4 3785
jane007
4 New Member
Any body know?
Please help me.
Thanks.
Oct 19 '07 #2
numberwhun
3,509 Recognized Expert Moderator Specialist
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
jane007
4 New Member
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
3,509 Recognized Expert Moderator Specialist
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

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

Similar topics

1
19349
by: sam | last post by:
I have a function writen in Perl that takes a name-value list (array) as argument and returns a name-value list (array). My question is: How to call this function from PHP and get the returned name-value list in PHP variable? Thanks.
4
2760
by: Patrick Useldinger | last post by:
Hi, I am writing a filter, i.e. a program that reads from stdin and writes to stdout. It works ok when run on its own, but does not work when I try to use another program's output. - The producer program (t1): print "a b c" print "d e f" - The filter program (t2):
3
3028
by: lonelyplanet999 | last post by:
Hi, I'm a newbie to perl and is now studying about perl programming, I read some perl programming tutorials online (enter 'Perl tutorial' at google.com) and also find some sample perl scripts for study. For below statements I couldn't understand what is the function of '$in'. I tried to search through the perl script tutorial pages since this morning (now it's afternoon) but still couldn't find the explanation. Could anyone help...
3
6547
by: dpackwood | last post by:
Hello, I have two different scripts that do pretty much the same thing. The main perl script is on Windows. It runs and in the middle of it, it then calls out another perl script that then should run on a Unix box I have. Both scripts run ok, except for the part when Windows try's to call out the Unix script. I have it set up where the Unix is mapped through a drive letter and can drop stuff into the Unix box. It is going through another...
12
3749
by: Jarod_24 | last post by:
I got a project called "Forms" that hold some forms and stuff in my solution. A argument at startup defines wether to use a From or Console. My plan was to create a myConsole class that would also allow my application to display a Console, but i don't seem to be allowed to do this. I don't see any References that i need to add, so how do i do this.
0
2307
by: Peter Conrey | last post by:
I have a perl web service (using SOAP::Lite) with a method called "Detail" that returns a strucure (hash reference to be exact). It works fine when consumed by a Perl client, but when I try to consume it with a C# application, I get the following runtime error from C#: Cannot assign object of type System.Xml.XmlNode to an object of type ConsoleApplication1.com.hilton.crmdev.SummaryType. Below is the Perl code that generates the hash,...
3
7485
by: Chris Paul | last post by:
I'm having trouble with PHP & PostgreSQL/OpenLDAP/Apache on Windows. I've set this up countless times on BSD (piece of cake) but I'm trying to do this on Windows now so that my developer can work on her local machine. Everything looks pretty good. OpenLDAP/cygwin works great. PostgreSQL works great. Apache runs. PHP runs. But when I try to connect to my PostgreSQL server using PHPPgAdmin, I
5
3204
by: oaktown | last post by:
Running two input forms on the same page, one php and the other (the one I would like to create) to be written in perl. The idea is to accept an input from a perl script, then pass that input to two other input fields, one in perl and the other in php. The two existing input fields (perl and php) are stand alone scripts. The perl script searches a flat text data base, while the php script searches a MySQL data base. The end result desired is to...
82
10024
by: happyse27 | last post by:
Hi All, I modified the user registration script, but not sure how to make it check for each variable in terms of preventing junk registration and invalid characters? Two codes below : a) html b) perl script (print and inserting into database) Cheers... Andrew
0
8597
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9148
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9012
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8880
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7708
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4357
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4611
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3034
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
1992
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.