GNU bug report logs - #6511
df output difficult to parse

Previous Next

Package: coreutils;

Reported by: Valerio Pachera <sirio81 <at> gmail.com>

Date: Fri, 25 Jun 2010 16:00:04 UTC

Severity: wishlist

Found in version 8.5

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Bob Proulx <bob <at> proulx.com>
To: Valerio Pachera <sirio81 <at> gmail.com>
Cc: 6511 <at> debbugs.gnu.org
Subject: bug#6511: df output difficult to parse
Date: Fri, 25 Jun 2010 15:09:56 -0600
Valerio Pachera wrote:
> 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.

Thank you for the report.  That is a nuisance!

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

Your request has been considered, found useful and a new option has
been added to df to enable this format.  Please use the -P option.
That will put all of the output on one line.

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

       -P, --portability
              use the POSIX output format

Please find this option already installed on your system.  I am so
glad that we could so quickly add this option for you! :-)

Bob




This bug report was last modified 14 years and 84 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.