Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having no swap causes division by zero in awk #38

Open
zejjnt opened this issue Oct 18, 2021 · 1 comment
Open

Having no swap causes division by zero in awk #38

zejjnt opened this issue Oct 18, 2021 · 1 comment

Comments

@zejjnt
Copy link

zejjnt commented Oct 18, 2021

When no swap file is used nor installed, bash/awk gives
awk: cmd. line:1: (FILENAME=- FNR=1) fatal: division by zero attempted

I've fixed it by manually commenting out the relevant lines and instead set the variables to zero; $Swap, $SwapFree and $SwapSize around row 320

I am not very proficient in bash but from a general programming aspect I am thinking it will be quite easy to fix for example by skipping the relevant equations if both swap size and swap free are equal to or below 0

Sincerely
Z
image

@hetrixtools
Copy link
Owner

Thank you for reporting this.
We are aware of this issue, and we'll try a fix for it in future patch releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants