Search Results

Search found 15 results on 1 pages for 'rockyurock'.

Page 1/1 | 1 

  • busybox does not display the throughput value at the end of a FTP session?

    - by rockyurock
    Hello, why busybox does not display the throughput value at the end of a FTP session? Or it is some version specific ? i heard that some version of busybox displays Tput value at the end of data transfer but i know that specific version .. i typed the below command but i did not get any throughput status.. "busybox ftpget -v -u user -p Password ip abc.txt abc.txt" could anybody please let me know how can i get the tput value for UL/DL data transfer? Also how can we get the status of Tput value at the client side if we do busybox ftpput operation?? regds rocky

    Read the article

  • How To Avoid a Perl script calling an Another Perl Script

    - by rockyurock
    Hello, i am calling a perl script client.pl from a main script to capture the output of client.pl in @output. is there anyway to avoid the use of these two files so i can use the output of client.pl in main.pl itself here is my code.... main.pl ======= my @output = readpipe("client.pl"); client.pl ========= #! /usr/bin/perl -w #use strict; use Socket; #initialize host and port my $host = shift || $FTP_SERVER; my $port = shift || $CLIENT_PORT; my $proto = getprotobyname('tcp'); #get the port address my $iaddr = inet_aton($host); my $paddr = sockaddr_in($port, $iaddr); #create the socket, connect to the port socket(SOCKET, PF_INET, SOCK_STREAM, $proto)or die "socket: $!\n"; connect(SOCKET, $paddr) or die "connect: $!\n"; my $line; while ($line = ) { print "$line\n"; } close SOCKET or die "close: $!"; /rocky..

    Read the article

  • How can I get the output of a command terminated by a alarm() call in Perl?

    - by rockyurock
    Case 1 If I run below command i.e iperf in UL only, then i am able to capture the o/p in txt file @output = readpipe("iperf.exe -u -c 127.0.0.1 -p 5001 -b 3600k -t 10 -i 1"); open FILE, ">Misplay_DL.txt" or die $!; print FILE @output; close FILE; Case 2 When I run iperf in DL mode , as we know server will start listening in cont. mode like below even after getting data from client (Here i am using server and client on LAN) @output = system("iperf.exe -u -s -p 5001 -i 1"); on server side: D:\_IOT_SESSION_RELATED\SEEM_ELEMESNTS_AT_COMM_PORT_CONF\Tput_Related_Tools\AUTO MATION_APP_\AUTOMATION_UTILITYiperf.exe -u -s -p 5001 ------------------------------------------------------------ Server listening on UDP port 5001 Receiving 1470 byte datagrams UDP buffer size: 8.00 KByte (default) ------------------------------------------------------------ [1896] local 192.168.5.101 port 5001 connected with 192.168.5.101 port 4878 [ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams [1896] 0.0- 2.0 sec 881 KBytes 3.58 Mbits/sec 0.000 ms 0/ 614 (0%) command prompt does not appear , process is contd... on client side: D:\_IOT_SESSION_RELATED\SEEM_ELEMESNTS_AT_COMM_PORT_CONF\Tput_Related_Tools\AUTO MATION_APP_\AUTOMATION_UTILITYiperf.exe -u -c 192.168.5.101 -p 5001 -b 3600k -t 2 -i 1 ------------------------------------------------------------ Client connecting to 192.168.5.101, UDP port 5001 Sending 1470 byte datagrams UDP buffer size: 8.00 KByte (default) ------------------------------------------------------------ [1880] local 192.168.5.101 port 4878 connected with 192.168.5.101 port 5001 [ ID] Interval Transfer Bandwidth [1880] 0.0- 1.0 sec 441 KBytes 3.61 Mbits/sec [1880] 1.0- 2.0 sec 439 KBytes 3.60 Mbits/sec [1880] 0.0- 2.0 sec 881 KBytes 3.58 Mbits/sec [1880] Server Report: [1880] 0.0- 2.0 sec 881 KBytes 3.58 Mbits/sec 0.000 ms 0/ 614 (0%) [1880] Sent 614 datagrams D:\_IOT_SESSION_RELATED\SEEM_ELEMESNTS_AT_COMM_PORT_CONF\Tput_Related_Tools\AUTO MATION_APP_\AUTOMATION_UTILITY so with this as server is cont. listening and never terminates so can't take output of server side to a txt file as it is going to the next command itself to create a txt file so i adopted the alarm() function to terminate the server side (iperf.exe -u -s -p 5001) commands after it received all data from the client. could anybody suggest me the way.. Here is my code: #! /usr/bin/perl -w my $command = "iperf.exe -u -s -p 5001"; my @output; eval { local $SIG{ALRM} = sub { die "Timeout\n" }; alarm 20; #@output = `$command`; #my @output = readpipe("iperf.exe -u -s -p 5001"); #my @output = exec("iperf.exe -u -s -p 5001"); my @output = system("iperf.exe -u -s -p 5001"); alarm 0; }; if ($@) { warn "$command timed out.\n"; } else { print "$command successful. Output was:\n", @output; } open FILE, ">display.txt" or die $!; print FILE @output_1; close FILE; i know that with system command i cannot capture the o/p to a txt file but i tried with readpipe() and exec() calls also but in vain... could some one please take a look and let me know why the iperf.exe -u -s -p 5001 is not terminating even after the alarm call and to take the out put to a txt file

    Read the article

  • How can I terminate a system command with alarm in Perl?

    - by rockyurock
    I am running the below code snippet on Windows. The server starts listening continuously after reading from client. I want to terminate this command after a time period. If I use alarm() function call within main.pl, then it terminates the whole Perl program (here main.pl), so I called this system command by placing it in a separate Perl file and calling this Perl file (alarm.pl) in the original Perl File using the system command. But in this way I was unable to take the output of this system() call neither in the original Perl File nor in called one Perl File. Could anybody please let me know the way to terminate a system() call or take the output in that way I used above? main.pl my @output = system("alarm.pl"); print"one iperf completed\n"; open FILE, ">display.txt" or die $!; print FILE @output_1; close FILE; alarm.pl alarm 30; my @output_1 = readpipe("adb shell cd /data/app; ./iperf -u -s -p 5001"); open FILE, ">display.txt" or die $!; print FILE @output_1; close FILE; In both ways display.txt is always empty.

    Read the article

  • How To Get The Outout of Win32::Process command in perl

    - by rockyurock
    hello all, i am using "use Win32::Process" for my application run as below, it runs fine but i did not get any way to get the output to a .txt file. i used NORMAL_PRIORITY_CLASS rather than CREATE_NEW_CONSOLE to get the output on the same terminal itself but i don't know how to redirect it to a txt file. /rocky !/usr/bin/perl use strict; use warnings; use Win32::Process; Win32::Process::Create(my $ProcessObj, "iperf.exe", "iperf.exe -u -s -p 5001", 0, NORMAL_PRIORITY_CLASS, ".") || die ErrorReport(); my @command_output; push @command_output,$ProcessObj; open FILE, "zz.txt" or die $!; print FILE @command_output; close FILE; sleep 10; $ProcessObj-Kill(0); sub ErrorReport{ print Win32::FormatMessage( Win32::GetLastError() ); }

    Read the article

  • Aplication Process never Terminates on each run

    - by rockyurock
    i am seeing an application always remains live even after closing the application using my below perl script.Also for the subsequent runs it always says that "The process cannot access the file because it is being used by another process.iperf.exe -u -s -p 5001 successful. Output was:" so everytime i have to change the file name $file used in script or i have to kill the iperf.exe process in the Task Manager. could anybody please let me know the way to get rid of it ? Here is the Code i am using ... my @command_output; eval { my $file = "abc6.txt"; $command = "iperf.exe -u -s -p 5001"; alarm 10; system("$command > $file"); alarm 0; close $file; }; if ($@) { warn "$command timed out.\n"; } else { print "$command successful. Output was:\n", $file; } unlink $file; /rocky

    Read the article

  • How can I parse this configuration file format (allowing comments) in Perl?

    - by rockyurock
    I am reading some parameters (from user input) from a .txt file and want to make sure that my script could read it even a space or tab is left before that particular parameter by user. Also if I want to add a comment for each parameter followed by # , after the parameter (e.g 7870 # this is default port number) to let the user know about the parameter How can I achieve it in same file? Right now, I am using split /\|\s/. Code: $data_file="config.txt"; open(RAK, $data_file)|| die("Could not open file!"); @raw_data=<RAK>; @Ftp_Server =split(/\|\s/,$raw_data[32]); config.txt (user input file) PING_TTL | 1 CLIENT_PORT | 7870 FTP_SERVER | 192.162.522.222 Could any body suggest me a robust way to do it? /rocky

    Read the article

  • How to Get The Output Of a command terminated by a alarm() call.

    - by rockyurock
    Case 1 If I run below command i.e iperf in UL only, then i am able to capture the o/p in txt file @output = readpipe("iperf.exe -u -c 127.0.0.1 -p 5001 -b 3600k -t 10 -i 1"); open FILE, ">Misplay_DL.txt" or die $!; print FILE @output; close FILE; Case 2 When I run iperf in DL mode , as we know server will start listening in cont. mode like below even after getting data from client (Here i am using server and client on LAN) @output = system("iperf.exe -u -s -p 5001 -i 1"); on server side: D:\_IOT_SESSION_RELATED\SEEM_ELEMESNTS_AT_COMM_PORT_CONF\Tput_Related_Tools\AUTO MATION_APP_\AUTOMATION_UTILITYiperf.exe -u -s -p 5001 ------------------------------------------------------------ Server listening on UDP port 5001 Receiving 1470 byte datagrams UDP buffer size: 8.00 KByte (default) ------------------------------------------------------------ [1896] local 192.168.5.101 port 5001 connected with 192.168.5.101 port 4878 [ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams [1896] 0.0- 2.0 sec 881 KBytes 3.58 Mbits/sec 0.000 ms 0/ 614 (0%) command prompt does not appear , process is contd... on client side: D:\_IOT_SESSION_RELATED\SEEM_ELEMESNTS_AT_COMM_PORT_CONF\Tput_Related_Tools\AUTO MATION_APP_\AUTOMATION_UTILITYiperf.exe -u -c 192.168.5.101 -p 5001 -b 3600k -t 2 -i 1 ------------------------------------------------------------ Client connecting to 192.168.5.101, UDP port 5001 Sending 1470 byte datagrams UDP buffer size: 8.00 KByte (default) ------------------------------------------------------------ [1880] local 192.168.5.101 port 4878 connected with 192.168.5.101 port 5001 [ ID] Interval Transfer Bandwidth [1880] 0.0- 1.0 sec 441 KBytes 3.61 Mbits/sec [1880] 1.0- 2.0 sec 439 KBytes 3.60 Mbits/sec [1880] 0.0- 2.0 sec 881 KBytes 3.58 Mbits/sec [1880] Server Report: [1880] 0.0- 2.0 sec 881 KBytes 3.58 Mbits/sec 0.000 ms 0/ 614 (0%) [1880] Sent 614 datagrams D:\_IOT_SESSION_RELATED\SEEM_ELEMESNTS_AT_COMM_PORT_CONF\Tput_Related_Tools\AUTO MATION_APP_\AUTOMATION_UTILITY so with this as server is cont. listening and never terminates so can't take output of server side to a txt file as it is going to the next command itself to create a txt file so i adopted the alarm() function to terminate the server side (iperf.exe -u -s -p 5001) commands after it received all data from the client. could anybody suggest me the way.. Here is my code: #! /usr/bin/perl -w my $command = "iperf.exe -u -s -p 5001"; my @output; eval { local $SIG{ALRM} = sub { die "Timeout\n" }; alarm 20; #@output = `$command`; #my @output = readpipe("iperf.exe -u -s -p 5001"); #my @output = exec("iperf.exe -u -s -p 5001"); my @output = system("iperf.exe -u -s -p 5001"); alarm 0; }; if ($@) { warn "$command timed out.\n"; } else { print "$command successful. Output was:\n", @output; } open FILE, ">display.txt" or die $!; print FILE @output_1; close FILE; i know that with system command i cannot capture the o/p to a txt file but i tried with readpipe() and exec() calls also but in vain... could some one please take a look and let me know why the iperf.exe -u -s -p 5001 is not terminating even after the alarm call and to take the out put to a txt file

    Read the article

  • STDOUT can not return to Screen

    - by rockyurock
    STDOUT can not return to Screen Hello all below is the part of my code, my code enters "if loop" with $value =1 and output of the process "iperf.exe" is getting into my_output.txt. As i am timing out the process after alram(20sec) time,also wanted to capture the output of this process only. then after i want to continue to the command prompt but i am not able to return to the command promt... not only this code itself does not PRINT on the command prompt , rather it is priniting on the my_output.txt file (i am looping this if loop through rest of my code) output.txt ========== inside value loop2 ------------------------------------------------------------ Server listening on UDP port 5001 Receiving 1470 byte datagrams UDP buffer size: 8.00 KByte (default) ------------------------------------------------------------ [160] local 10.232.62.151 port 5001 connected with 10.232.62.151 port 1505 [ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams [160] 0.0- 5.0 sec 2.14 MBytes 3.59 Mbits/sec 0.000 ms 0/ 1528 (0%) inside value loop3 clue1 clue2 inside value loop4 one iperf completed Transfer Transfer Starting: Intent { act=android.settings.APN_SETTINGS } ******AUTOMATION COMPLETED****** Looks some problem with reinitializing the STDOUT.. even i tried to use close(STDOUT); but again it did not return to STDOUT could sombbody please help out ?? /rocky CODE:: if($value) { my $file = 'my_output.txt'; use Win32::Process; print"inside value loop\n"; # redirect stdout to a file open STDOUT, '>', $file or die "can't redirect STDOUT to <$file> $!"; Win32::Process::Create(my $ProcessObj, "iperf.exe", "iperf.exe -u -s -p 5001", 0, NORMAL_PRIORITY_CLASS, ".") || die ErrorReport(); $alarm_time = $IPERF_RUN_TIME+2; #20sec print"inside value loop2\n"; sleep $alarm_time; $ProcessObj->Kill(0); sub ErrorReport{ print Win32::FormatMessage( Win32::GetLastError() ); } print"inside value loop3\n"; print"clue1\n"; #close(STDOUT); print"clue2\n"; print"inside value loop4\n"; print"one iperf completed\n"; } my $data_file="my_output.txt"; open(ROCK, $data_file)|| die("Could not open file!"); @raw_data=<ROCK>; @COUNT_PS =split(/ /,$raw_data[7]); my $LOOP_COUNT_PS_4 = $COUNT_PS[9]; my $LOOP_COUNT_PS_5 = $COUNT_PS[10]; print "$LOOP_COUNT_PS_4\n"; print "$LOOP_COUNT_PS_5\n"; my $tput_value = "$LOOP_COUNT_PS_4"." $LOOP_COUNT_PS_5"; print "$tput_value"; close(ROCK); print FH1 "\n $count \| $tput_value \n"; regds rakesh

    Read the article

  • How do I get the output of Win32::Process command in Perl?

    - by rockyurock
    I am using use Win32::Process for my application run as below. It runs fine, but I did not get any way to get the output to a .txt file. I used NORMAL_PRIORITY_CLASS rather than CREATE_NEW_CONSOLE to get the output on the same terminal itself, but I don't know how to redirect it to a txt file. /rocky #!/usr/bin/perl use strict; use warnings; use Win32::Process; Win32::Process::Create(my $ProcessObj, "iperf.exe", "iperf.exe -u -s -p 5001", 0, NORMAL_PRIORITY_CLASS, ".") || die ErrorReport(); my @command_output; push @command_output,$ProcessObj; open FILE, ">zz.txt" or die $!; print FILE @command_output; close FILE; sleep 10; $ProcessObj->Kill(0); sub ErrorReport{ print Win32::FormatMessage( Win32::GetLastError() ); }

    Read the article

  • OUTPUT DID NOT REDIRECT TO THE INTENDED FILE OPENED FOR..

    - by rockyurock
    HELLO ALL, I USED THE BELOW CODE FOR CAPTURING THE OUTPUT (BELOW IN lines) IN A FILE "my_output.txt" BUT FAILED TO CAPTURE. **************output*************** inside value loop ------------------------------------------------------------ Server listening on UDP port 5001 Receiving 1470 byte datagrams UDP buffer size: 108 KByte (default) ------------------------------------------------------------ [ 3] local 192.168.16.2 port 5001 connected with 192.168.16.1 port 3189 [ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams [ 3] 0.0- 5.0 sec 2.14 MBytes 3.61 Mbits/sec 0.369 ms 0/ 1528 (0%) inside value loop3 clue1 clue2 inside value loop4 one iperf completed *************************************** however when i enabled the local *STDOUT; in below code then i could see the above output on command prompt display (ofcourse server is sending some data). could anybody suggest me how can i capture the o/p in a file intended? below is the code i am using .. my $file = 'my_output.txt'; use Win32::Process; print"inside value loop\n"; # redirect stdout to a file #local *STDOUT; open STDOUT, '>', $file or die "can't redirect STDOUT to <$file> $!"; Win32::Process::Create(my $ProcessObj, "D:\\IOT_AUTOMATION_UTILITY\\_SATURDAY_09-04-10\\adb_cmd.bat", "adb shell /data/app/iperf -u -s -p 5001", 0, NORMAL_PRIORITY_CLASS, ".") || die ErrorReport(); #$alarm_time = $IPERF_RUN_TIME+10; #20sec #$ProcessObj->Wait(40); #print"inside value loop2\n"; #sleep $alarm_time; sleep 40; $ProcessObj->Kill(0); sub ErrorReport{ print Win32::FormatMessage( Win32::GetLastError() ); } /rocky

    Read the article

  • splitting on all kind of spaces and tabs

    - by rockyurock
    hello, i am reading some parameters(from user input) from a .txt file and want to make sure that my script could read it even a space or tab is left before that particular parameter by user. also if i want to add a comment for each parameter followed by # , after the parameter (e.g 7870 #this is default port number) to let the user know about the parameter how can i achieve it in same file ? here is wat i am using (/\|\s/) code:: $data_file="config.txt"; open(RAK, $data_file)|| die("Could not open file!"); @raw_data=; @Ftp_Server =split(/\|\s/,$raw_data[32]); config.txt (user input file) PING_TTL | 1 CLIENT_PORT | 7870 FTP_SERVER | 192.162.522.222 could any body suggest me a robust way to do it? /rocky

    Read the article

  • How do I redirect standard output to a file in Perl? [closed]

    - by rockyurock
    I want to send standard output to the file "my_output.txt" but failed. Here's the output: inside value loop ------------------------------------------------------------ Server listening on UDP port 5001 Receiving 1470 byte datagrams UDP buffer size: 108 KByte (default) ------------------------------------------------------------ [ 3] local 192.168.16.2 port 5001 connected with 192.168.16.1 port 3189 [ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams [ 3] 0.0- 5.0 sec 2.14 MBytes 3.61 Mbits/sec 0.369 ms 0/ 1528 (0%) inside value loop3 clue1 clue2 inside value loop4 one iperf completed *************************************** When I enable the local *STDOUT; in below code then I could see the above output on command prompt display (ofcourse server is sending some data): my $file = 'my_output.txt'; use Win32::Process; print"inside value loop\n"; # redirect stdout to a file #local *STDOUT; open STDOUT, '>', $file or die "can't redirect STDOUT to <$file> $!"; Win32::Process::Create(my $ProcessObj, "D:\\IOT_AUTOMATION_UTILITY\\_SATURDAY_09-04-10\\adb_cmd.bat", "adb shell /data/app/iperf -u -s -p 5001", 0, NORMAL_PRIORITY_CLASS, ".") || die ErrorReport(); #$alarm_time = $IPERF_RUN_TIME+10; #20sec #$ProcessObj->Wait(40); #print"inside value loop2\n"; #sleep $alarm_time; sleep 40; $ProcessObj->Kill(0); sub ErrorReport{ print Win32::FormatMessage( Win32::GetLastError() ); }

    Read the article

  • Application process never terminates on each run

    - by rockyurock
    I am seeing an application always remains live even after closing the application using my Perl script below. Also, for the subsequent runs, it always says that "The process cannot access the file because it is being used by another process. iperf.exe -u -s -p 5001 successful. Output was:" So every time I have to change the file name $file used in script or I have to kill the iperf.exe process in the Task Manager. Could anybody please let me know the way to get rid of it? Here is the code I am using ... my @command_output; eval { my $file = "abc6.txt"; $command = "iperf.exe -u -s -p 5001"; alarm 10; system("$command > $file"); alarm 0; close $file; }; if ($@) { warn "$command timed out.\n"; } else { print "$command successful. Output was:\n", $file; } unlink $file;

    Read the article

1