473,396 Members | 1,765 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Re:Perl system( ) command execution.

1
Hi,
Recently I started to learn Perl programming.I am using windows 7 OS. Please find the following Perl program. If I execute the below script it will show the output. The issue is that if i am executing the same script immediately again it won't execute. If I wait for5 minutes, then it executes.
I tried the same scripts in XP,it is working properly.

Expand|Select|Wrap|Line Numbers
  1. print "Enter the command \n";
  2. chomp($cmd=<stdin>);
  3. system("$cmd>ping.txt");
  4. open($fh,"<","ping.txt") or die "could not open the file \n";
  5. print "\n \n \n \n";
  6. while($line=<$fh>)
  7.  {
  8.    if($line=~m/minimum/i)
  9.       {
  10.          print "Appropriate round trip time:  \n";
  11.          print "$line \n";
  12.        }
  13.  }
Thanks,
Dav
Oct 5 '12 #1
0 1345

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

Similar topics

3
by: Nicolas Fleury | last post by:
Hi, How can I know if a system command doesn't exist? All the ways I have tried behave like if the system command was existing but returning one. I don't want to sound provocative, but open in...
15
by: Sokar | last post by:
Hello, I am writing a script which is using the system() command. In the script the system command invokes an encryption with system("gpg -f file.txt"). The problem comes when the script is...
6
by: jsw_nz | last post by:
Helo, my first post here.... I am trying to run an agent application that converts and imports two tables from MS Access into mySql. (Intelligent Converters - Access2mySql) I have run similar...
1
by: darren kirby | last post by:
Hello all. I have a python script here which is just a wrapper for 2 or more system commands. I would estimate the program spends at least 95.5% of 'real' time running the system commands. ...
11
by: jobs239 | last post by:
Can I use this line inside C program "system(java -jar <jarfilename>)" to run a java program from C? Or do I have to use some JNI interface.?
3
by: rmasi | last post by:
I am using some CGI Perl code as part of a web site I am developing on a windows xp machine. I had this working fine on one computer, but I had to move this to another windows xp machine and now the...
1
by: klmishraa79 | last post by:
i want to know how i can put a time delay between two command execution...i.e. after first command of programm the second command should execute after some fixed delay......i want to use time delay...
3
by: pavi | last post by:
Hi, I am using system command to execute a shell script in a C program. Usage system("sh file"). There are situations where the file may be empty. But execution gets hung if the file is empty....
6
by: Varlamov Konstantyn | last post by:
I have simple script: <?php $connection = ssh2_connect("ip", 22); ssh2_auth_password($connection,"login","test");
4
by: boriq | last post by:
Hi, I'm using in my script command os.system('command') on Windows XP. Each time the os.system command is used, python opens an empty ms-dos command window (the black one) and then closes it. So...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.