Search Results

Search: Posts Made By: daptal
1,992
Posted By daptal
You get the additional rows when you skip the...
You get the additional rows when you skip the '/^\s*$/' line.

The line /^\s*$/ means any line that just contains white spaces or empty

If you notice your input file the format is as follows...
19,206
Posted By daptal
while(my $line = <FILE>) { chomp $line;...
while(my $line = <FILE>) {
chomp $line;
if ($line){
if ($line =~ m/HOSTNAME\ (.*)/){
$hostname = $1;
}
...
Showing results 1 to 2 of 2

 
All times are GMT -4. The time now is 04:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy