November 11th, 2013, 04:29 AM
PERL Command Line Help
I am new to PERL and I have to migrate PERL code to JAVA.. When I am going through the code I got the Following command line argument
"bwstat.pl --delay 5 --count 720 > ./logs/bwstat.log &
/usr/sbin/ntpdate -bus date.goole.yahoo.com"
and this file contains code like this
# default settings
$version = "20120203";
$device = "eth0";
$delay = 5;
$count = 1;
"delay=i" => \$delay,
"count=i" => \$count,
"dev=s" => \$device,
"header" => \$header,
"version" => \$needVersion,
"h|help" => \$needHelp);
can u please explain what is mean by "> ./logs/bwstat.log &
/usr/sbin/ntpdate -bus date.goole.yahoo.com" in command line
Thanks in advance..
November 11th, 2013, 09:02 AM
Those are just unix directives about how to run a process. They aren't part of perl.
This first one:
Says to run the perl script 'bwstat.pl' with the provided arguments, and to redirect STDOUT to the bwstat.log file.
It may have made more sense to hardcode output within the bwstat.pl file to write to a specific log file, but redirection allows for flexibility. The user can change the output location at run time. They have to know to do that however, or they'll just get a screenful of printed output.
The ampersand at the end of the line says to run it as a background process.
run in background
The second line is a unix utility to update the system time from a remote server:
November 12th, 2013, 01:29 AM
Thanks a lot for Explanation..