[Sfw-team] [OpenIndiana Distribution - Bug #827] (GNU) df gives multiline output even when piped

illumos project devnull at illumos.org
Sun Apr 17 11:40:46 UTC 2011


Issue #827 has been updated by Julian Wiesener.

Category set to SFW (Solaris Freeware)
Assigned to set to OI SFW

Workarround: Do not use GNU df for your shell scripts

root at laphroaig:~# /usr/gnu/bin/df -k | grep -i long_long
rpool/filesystem_with_long_long_long_long_long_long_long_long_name
root at laphroaig:~# /usr/bin/df -k | grep -i long_long    
rpool/filesystem_with_long_long_long_long_long_long_long_long_name 76382208      21 24797798     1%    /mnt
----------------------------------------
Bug #827: (GNU) df gives multiline output even when piped
https://www.illumos.org/issues/827

Author: Jim Klimov
Status: New
Priority: Normal
Assigned to: OI SFW
Category: SFW (Solaris Freeware)
Target version: 


When 'df' program encounters "long" device or mountpoint names, it makes the terminal output prettier by splitting such lines into two and space-padding the output.

However, and many scripts historically depended on it, 'df' produces a single line per filesystem when piped (to grep, awk or whatever). This works with both Solaris and Linux (GNU?) df variants.

However, the /usr/gnu/bin/df in OI_148a LiveUSB lacks this feature:

root at openindiana:~# df -k /a
Filesystem           1K-blocks      Used Available Use% Mounted on
rpool/ROOT/openindiana
                      16717979   2968243  13749736  18% /a


root at openindiana:~# df -k | grep openindiana
rpool/ROOT/openindiana

This is a bug and should be fixed - it can break an indeterminate number of scripts and programs which rely on parsing the 'df' output.

//Jim Klimov




-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://www.illumos.org/my/account



More information about the Sfw-team mailing list