BB Unix Network Monitor - Message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: {bb} disk status with lvm



I don't quite understand the question.
 
- Maybe that problem is caused by "autowrap" of the terminal display. This should not affect any scripts then.
- Or is df producing output that is wrapped on multiple lines? Maybe there is a command line option to disable that?
 
If you want to combine two lines that are separated by slash-newline,
then you can use this quick and dirty solution:
 
echo "$problematic_lines" | awk ' { L = $0 }; /\/$/ { gsub("/$","",L); getline ; L = L $0 }; { print L } '
 
Here we use awk to
1) store the whole line in variable L
2) for each line ending in / (pattern: "/\/$/" ): remove the last / from L
3) read next line
4) print L and that "next" line
 
Brutal, but works
(until you have the root directory / there...)(solution: "NR>1 && /\/$/" )
 


From: owner-bb@bb4.com [mailto:owner-bb@bb4.com] On Behalf Of Daniel Bierstedt
Sent: Tuesday, September 27, 2005 4:47 PM
To: bb@bb4.com
Subject: {bb} disk status with lvm

Hello,

 

i´m trying to get disk information from my suse server, but it seems that the line is too long for the display. The output looks like that:

 

/dev/mapper/data-data

/dev/sd2                 ******                       ****          60%        /

 

You see, the volume information of the lv ?data? is missing. The output of df for the lv is in two lines?


Home | Main Index | Thread Index