|
Hi, I want to properly format the output of the df command and store the output in the array, the problem here is, in the third line if u guyz c when the location file system path extends the size, %, mounted on.. goes to next line when i try to push the values in the array line by line i want this to appear in one line.. any help is much appreciated.
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda3 497861 224899 247258 48% /
/dev/sda1 147764 77278 62857 56% /boot
/dev/mapper/rootvg-tmp
6063688 105684 5649988 2% /tmp
|
|
|
Here is the code which i hv written
#! /usr/local/bin
open(DF, "df|");
while(<FH>){
chomp();
next if (/^\/proc\b/);
printf("FH %s\n",$_);
push(@df_output, $);
}
close (DF);
When i push the line in the array, it should complete data in one line.
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda3 497861 224899 247258 48% /
/dev/sda1 147764 77278 62857 56% /boot
/dev/mapper/rootvg-tmp
6063688 105684 5649988 2% /tmp
|
|
|
|
|
|
|
|