Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

Conversation

@revl
Copy link
Contributor

@revl revl commented Apr 16, 2020

Change Description

When called without any parameter to override the block size, /bin/df uses the $BLOCKSIZE environment variable. That variable may contain units like K, M, G, etc.

Before this commit, general.sh took the value of $BLOCKSIZE from the output of df and used it in arithmetic expressions, which broke them because of the unit suffixes.

This commit adds the highly portable -k option to the df invocation to explicitly set the value of block size to 1024.

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

When called without any parameter to override the block size, '/bin/df'
uses the $BLOCKSIZE environment variable. That variable may contain
units like K, M, G, etc.

Before this commit, general.sh took the value of $BLOCKSIZE from the
output of 'df' and used it in arithmetic expressions, which broke them
because of the unit suffixes.

This commit adds the higly portable '-k' option to the 'df' invocation
to explicitly set the value of block size to 1024.
@heifner heifner requested a review from scottarnette April 16, 2020 17:44
Copy link
Contributor

@scottarnette scottarnette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥇

@revl revl merged commit 8ab8387 into develop Apr 16, 2020
@revl revl deleted the fix-df-invocation-dev branch April 16, 2020 23:03
@revl revl mentioned this pull request Apr 16, 2020
3 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants