Sun, 07 Nov 2021 17:35:42 -0700 Todd C. Miller <mill...@openbsd.org>
> df honors the BLOCKSIZE environment variable so you can already do
> things like:
> 
>     $ BLOCKSIZE=1m df
>     Filesystem  1M-blocks      Used     Avail Capacity  Mounted on
>     /dev/sd1a        1008       175       782    18%    /
>     /dev/sd1m      124124     29107     88810    25%    /home
>     /dev/sd1d        4035         0      3833     0%    /tmp
>     /dev/sd1g        2413      2110       181    92%    /usr
>     ...
> 
>  - todd
> 

Hello sbrk,

It's well documented, so we can't just pretend it's never been mentioned so far.

https://man.openbsd.org/df.1#ENVIRONMENT

Sun, 7 Nov 2021 16:07:20 GMT s...@sdf.org
> >Synopsis:    df(1) missing -m and -g options 
> >Category:    Userland        
> >Environment:  
>       System      : OpenBSD 7.0
>       Details     : OpenBSD 7.0 (GENERIC.MP) #232: Thu Sep 30 14:25:29 MDT 
> 2021
>                        
> dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> 
>       Architecture: OpenBSD.amd64
>       Machine     : amd64
> >Description:  
>       df(1) is missing the standard options to display size units in
>       Megabytes or Gigabytes. Yes, I know about -h, and that is unhelpful,
>       just like it is on Linux.
> >How-To-Repeat:  
>       df -m
>       df -g
> >Fix:  
>       Copy the code from FreeBSD's df(1) and you'd be set.

That's not how standardisation works, that's how problems get propagated around.

https://man.openbsd.org/df.1#STANDARDS
https://man.netbsd.org/df.1#HISTORY
https://www.freebsd.org/cgi/man.cgi?df#end

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/df.html

We just read the manual page before a bug submission, then test better, further.
Also, for sorting trivial conversions there is awk(1) for scripting and related.

--
Kind regards,
Anton Lazarov
MScEng EECSIT

Reply via email to