codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Help needed to format the output of df command  powerfulperl at 04:02 on Monday, February 22, 2010
 

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

  Re: Help needed to format the output of df command  powerfulperl at 08:37 on Tuesday, February 23, 2010
 

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









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: horizontal scroll bar for drop down list box
•  Re: Help needed to format the output of df command
•  How to enable windows lan id using asp.net code
•  Re: converting pst files from outlook to excel??
•  Re: Insert Contents of .txt file into a .html page
•  Re: Using Lucene or Solr ?
•  com ports in windows 7
•  How do I use PHP with Solr?
•  Need to enter XML content into HTML formatted email document


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2010