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

illumos project devnull at illumos.org
Sun Apr 17 15:06:49 UTC 2011


Issue #827 has been updated by Jim Klimov.


Workaround is relatively suitable, except:
1) Many (legacy/packaged) scripts I've encountered and written rely on system PATH. 
If OI sets by default that GNU/bin would be before system /usr/bin, and those utilities don't work properly, it is an issue. Changing all these scripts on each installation (or changing the /etc/profile and wherever else the GNU path is prepended) is not practical.
2) In this particular case, the scripts that broke for me are portable between RHEL and (Open)Solaris, and in both platforms the default "df" worked properly. I'm pretty sure that Linux "df" is a GNU "df", so I view that change in behavior as a regression/incompatibility/whatever.
//Jim
----------------------------------------
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