BTS

Message3154

Author mika
Recipients korn
Date 2010-04-26.16:26:36
Content
* Andras Korn wrote in grml's BTS on 20100423 / 18:27:

> please consider including this in your zshrc:

> function df() {
> 	/bin/df -a --portability "$@" | column -t | sed
> 's/Mounted[[:space:]]*on/Mounted on/'
> }

> This makes df output a lot more readable by making sure that all information for
> each filesystem is on a single line and still nicely tabulated.

> Observe the difference between the old and new behaviour:
[...]

> Including the -a (which causes "dummy" filesystems to be included) is useful
> especially for chroots and vservers with bind mounted filesystems; if /etc/mtab
> includes an entry where the device doesn't exist, df will by default skip that
> entry in the output, which is the wrong thing to do for bind mounts. I don't
> think there are so many actual dummy filesystems that their inclusion would
> seriously clutter the output of df.

> Placing this function in zshrc would ensure that it's only loaded for
> interactive shells; thus it wouldn't interfere with scripts that attempt to
> parse the output of df(1).

I like the idea but don't think changing behaviour of traditional
UNIX commands is a good idea. Though I'd ACK this function under a
different name, suggestions welcome. :)

regards,
-mika-
History
Date User Action Args
2010-04-26 16:26:40mikasetrecipients: + korn
2010-04-26 16:26:38mikalinkissue845 messages
2010-04-26 16:26:36mikacreate