On 09/01/2023 22:04, Thomson Blakefield wrote:
Create new option 'df -b' like *BSD platforms, to explicitly use 512-byte 
blocks, overriding any BLOCKSIZE specification from the environment.

BSD's options '-P' and '-b' are the same and use 512-byte blocks.
However GNU 'df -P' uses 1024-byte block, which makes scripts not portable.

I can use 'df -k' which is the same for both but results are inaccurate after 
conversion.

Given you can define a portable df-b function as follows,
it's probably best not to add a -b option for this.

  df-b() { POSIXLY_CORRECT=1 df -P "$@"; }

cheers,
Pádraig




Reply via email to