Debian Bug report logs - #261552
df: breaks lines even when output is not a tty

version graph

Package: coreutils; Maintainer for coreutils is Michael Stone <[email protected]>; Source for coreutils is src:coreutils (PTS, buildd, popcon).

Reported by: Eric Yagerlener <[email protected]>

Date: Mon, 26 Jul 2004 17:33:01 UTC

Severity: minor

Tags: wontfix

Found in version 5.0.91-2

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Michael Stone <[email protected]>:
Bug#261552; Package coreutils. (full text, mbox, link).


Acknowledgement sent to Eric Yagerlener <[email protected]>:
New Bug report received and forwarded. Copy sent to Michael Stone <[email protected]>. (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Eric Yagerlener <[email protected]>
To: [email protected]
Subject: df: text formatting issues when kernel uses devfs
Date: Mon, 26 Jul 2004 13:23:38 -0400 (EDT)
Subject: df: text formatting issues when kernel uses devfs
Package: coreutils
Version: 5.0.91-2
Severity: normal

Unlike the command ps which will adjust its text formatting for the width 
of the terminal, and will not truncate or otherwise add extra linefeeds to 
its output if stdout is directed to a pipe or file, df always formats the 
text for an 80 column terminal regardless of actual terminal width or if 
stdout is a pipe or a file.

The linefeed after the device name breaks perl and shell scripts that 
parse df's output.  df should never attempt to split lines if it's 
outputing to a pipe or a file.  Even if the terminal is wide enough to 
display the data in one line, the extra linefeed is still inserted 
regardless.  The text formatting should be changed to be more 
concise when dealing with kernels that use devfs.

Sample Ugly Output:

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/ide/host0/bus1/target0/lun0/part3
                      14259064  11277248   2836952  80% /
tmpfs                   128404         0    128404   0% /dev/shm
/dev/ide/host0/bus1/target0/lun0/part1
                         29737      1776     27347   7% /boot
/dev/ide/host0/bus0/target0/lun0/part3
                      79723696  32051984  43684784  43% /video

With more space efficient text formatting, the output will almost fit an 
80 column display.

Filesystem           		       1K-blocks      Used Available Use% Mounted on
/dev/ide/host0/bus1/target0/lun0/part3  14259064  11277248   2836952  80% / 
tmpfs                                     128404         0    128404   0% /dev/shm
/dev/ide/host0/bus1/target0/lun0/part1     29737      1776     27347   7% /boot
/dev/ide/host0/bus0/target0/lun0/part3  79723696  32051984  43684784  43% /video

df -h is even uglier.

Filesystem            Size  Used Avail Use% Mounted on
/dev/ide/host0/bus1/target0/lun0/part3
                       14G   11G  2.8G  80% /
tmpfs                 126M     0  126M   0% /dev/shm
/dev/ide/host0/bus1/target0/lun0/part1
                       30M  1.8M   27M   7% /boot
/dev/ide/host0/bus0/target0/lun0/part3
                       77G   31G   42G  43% /video

With some reformatting it WILL fit an 80 column display properly!

Filesystem            			Size  Used Avail Use% Mounted on
/dev/ide/host0/bus1/target0/lun0/part3   14G   11G  2.8G  80% /
tmpfs                 			126M     0  126M   0% /dev/shm
/dev/ide/host0/bus1/target0/lun0/part1	 30M  1.8M   27M   7% /boot
/dev/ide/host0/bus0/target0/lun0/part3   77G   31G   42G  43% /video



-- System Information
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux athlon-xp 2.4.26 #1 Sat Jul 24 11:22:24 EDT 2004 i686
Locale: LANG=en_US, LC_CTYPE=en_US

Versions of packages coreutils depends on:
ii  libacl1                     2.2.23-1     Access control list shared library
ii  libattr1                    2.4.16-1     Extended attribute shared library
ii  libc6                       2.3.2.ds1-13 GNU C Library: Shared libraries an

---
Eric Yagerlener



Information forwarded to [email protected], Michael Stone <[email protected]>:
Bug#261552; Package coreutils. (full text, mbox, link).


Acknowledgement sent to "Arthur Korn" <[email protected]>:
Extra info received and forwarded to list. Copy sent to Michael Stone <[email protected]>. (full text, mbox, link).


Message #10 received at [email protected] (full text, mbox, reply):

From: "Arthur Korn" <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: nothing to do with devfs
Date: Tue, 31 Aug 2004 20:20:21 +0200
retitle 261552 df: breaks lines even when output is not a tty
thanks

Hi

This has nothing to do with devfs, devfs only happens to produce
quite long device names, but it breaks regardless of why the
lines get so long.

ciao, 2ri
-- 
Help securing email, spread GPG, clearsign all mail. http://www.gnupg.org
.
Following the First World War, Austrian journalist Karl Wiegand made an
interesting observation. "How are nations ruled and led into war?" he asked.
"Politicians lie to journalists and then believe those lies when they see them
in print." This may seem cynical, but it was true then, and it is true today.
  -- http://www.disinfopedia.org/wiki.phtml?title=Weapons_of_mass_deception



Changed Bug title. Request was from "Arthur Korn" <[email protected]> to [email protected]. (full text, mbox, link).


Information forwarded to [email protected], Michael Stone <[email protected]>:
Bug#261552; Package coreutils. (full text, mbox, link).


Acknowledgement sent to Thomas Hood <[email protected]>:
Extra info received and forwarded to list. Copy sent to Michael Stone <[email protected]>. (full text, mbox, link).


Message #17 received at [email protected] (full text, mbox, reply):

From: Thomas Hood <[email protected]>
To: [email protected]
Subject: Behavior unchanged
Date: Thu, 22 Dec 2005 14:42:28 +0100
In 5.2.1 df still breaks lines if writing to a pipe

jdthood@turmeric:/mnt$ df | cat -
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda7             11191604   7108712   3514384  67% /
/dev/hda6             10082852   7811056   1759608  82% /mnt/hda6
/dev/hda3               490496     14350    450820   4% /mnt/hda3
tmpfs                   257336        16    257320   1% /dev/shm
jdsklfjsaklffjdsjfkldsjfkldsjfkldjslfkdsj
                        257336         0    257336   0% /mnt/x
$ df --version
df (coreutils) 5.2.1




Message sent on to Eric Yagerlener <[email protected]>:
Bug#261552. (full text, mbox, link).


Message #20 received at [email protected] (full text, mbox, reply):

From: Thomas Hood <[email protected]>
To: [email protected]
Subject: Workaround
Date: Thu, 22 Dec 2005 14:48:12 +0100
This may help you:

`-P'
`--portability'
     Use the POSIX output format.  This is like the default format
     except for the following:

       1. The information about each filesystem is always printed on
          exactly one line; a mount device is never put on a line by
          itself.  This means that if the mount device name is more
          than 20 characters long (e.g., for some network mounts), the
          columns are misaligned.

       2. The labels in the header output line are changed to conform
          to POSIX.

$ df --portability
Filesystem         1024-blocks      Used Available Capacity Mounted on
/dev/hda7             11191604   7108748   3514348      67% /
/dev/hda6             10082852   7811056   1759608      82% /mnt/hda6
/dev/hda3               490496     14350    450820       4% /mnt/hda3
tmpfs                   257336        16    257320       1% /dev/shm
jdsklfjsaklffjdsjfkldsjfkldsjfkldjslfkdsj    257336         0    257336       0% /mnt/x
$ df --version
df (coreutils) 5.2.1

-- 
Thomas Hood



Severity set to `minor'. Request was from Thomas Hood <[email protected]> to [email protected]. (full text, mbox, link).


Tags added: wontfix Request was from Thomas Hood <[email protected]> to [email protected]. (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 08:44:54 2025; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.