Project

General

Profile

Actions

Bug #827

closed

(GNU) df gives multiline output even when piped

Added by Jim Klimov over 10 years ago. Updated about 10 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
OI-Userland
Target version:
Start date:
2011-03-17
Due date:
2011-09-14
% Done:

0%

Estimated time:
8.00 h
Difficulty:
Medium
Tags:
needs-triage

Description

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@openindiana:~# df -k /a
Filesystem 1K-blocks Used Available Use% Mounted on
rpool/ROOT/openindiana
16717979 2968243 13749736 18% /a

root@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

Actions

Also available in: Atom PDF