Subject: bug#6511: closed (df no longer wraps lines)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 24 Mar 2011 00:15:03 +0000

Your bug report

#6511: df output difficult to parse

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
6511: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6511
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: df no longer wraps lines
From: Pádraig Brady <[email-masked]>
To: [email-masked], [email-masked]
Date: Thu, 24 Mar 2011 00:11:40 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Since I've just changed df to no longer split
entries with long device names over two lines
(since it now aligns columns consistently),
I'm closing these.

cheers,
Pádraig

Subject: df output difficult to parse
From: Valerio Pachera <[email-masked]>
To: [email-masked]
Date: Fri, 25 Jun 2010 17:43:22 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Package: GNU coreutils
Version: 8.5

Severity: wishlist

Description:
I'm trying to parse di output of df command to check how much free
space is left on my disks.
I need to check this by a script.
The problem is that, when the device name is long, we get a new line
in the output (see example below).
It's difficult then have data relate with the device name or mount
poiunt usign grep and awk.

Proposed Solution:
simply add an option to not wrap the output text.

File system           Dim. Usati Disp. Uso% Montato su
/dev/mapper/VolGroup00-testing
                      9,2G  3,3G  5,5G  38% /
tmpfs                 1,5G     0  1,5G   0% /lib/init/rw
udev                   10M  224K  9,8M   3% /dev
tmpfs                 1,5G   12K  1,5G   1% /dev/shm
/dev/mapper/VolGroup00-dati
                      120G   77G   38G  68% /mnt/dati
/dev/mapper/VolGroup00-opt
                      5,0G  963M  3,8G  21% /opt
/dev/mapper/VolGroup00-var
                      5,0G  974M  3,8G  21% /var
fileserver:/pubblica  1,4T  579G  722G  45% /media/pubblica
proxy:/mnt/dati/ftp   9,8G  7,3G  2,0G  79% /media/ftp
/dev/sdb1             977M  852M  125M  88% /media/VALERIO

###### trying to extract used % ######

$ df -h /dev/mapper/VolGroup00-dati  | awk '{print $4}'
Usati

68%

$ df -h /dev/sdb1 | awk '{print $4}' | tr -d %
Usati
125M

Ad you can see, the colum 4 is not the same (used% in the first case,
Total space in the second).

Thank you