sasuser2006
Technical User
I am running a perl script on a brand new linux box and I've executed it three times and all three times the OS has rebooted mid way through the script.
I've ran the script successfully on a 10 record file and it works but the file I need to run it on is 192MM records and 1109 bytes long ~220GB.
My thought is maybe there is a setting that needs tweaking on the box or there is a parameter I can pass in the script. Any help troubleshooting would be appreciated. Thanks in advance for the help.
I've ran the script successfully on a 10 record file and it works but the file I need to run it on is 192MM records and 1109 bytes long ~220GB.
My thought is maybe there is a setting that needs tweaking on the box or there is a parameter I can pass in the script. Any help troubleshooting would be appreciated. Thanks in advance for the help.
Code:
#!/usr/bin/perl
my $total_recs=0;
my $good_recs=0;
my $bad_recs=0;
open(BAD,">/u02/staging/$ARGV[1].bad");
open(GOOD,">/u02/staging/$ARGV[1].good");
while(<STDIN>)
{
$total_recs++;
chomp;
$record_length = length($_);
if ($record_length == $ARGV[0])
{
print GOOD "$_\n";
$good_recs++;
}
else
{
print BAD "$_\n";
$bad_recs++;
}
}
print STDERR "<$total_recs> records read by script\n\n";
print STDERR "<$bad_recs> records written to $ARGV[1].bad\n\n";
print STDERR "<$good_recs> records written to $ARGV[1].good\n\n";
close BAD;
close GOOD;