Projet

Général

Profil

Révision 7a05e29c

ID7a05e29c763478f461a43a6f7f54a4ad8861f42e
Parent 617994ca
Enfant f8264132

Ajouté par northox il y a presque 14 ans

Fix bug with Gibibyte

Voir les différences:

plugins/other/openbsd-memory
13 13

  
14 14
top -un | nawk '
15 15
function scale(v) {
16
  if (value ~ /G$/) { sub("G", "", v); v *= 1024 }
16
  if (v ~ /G$/) { sub("G", "", v);v *= 1024 }
17 17
  else if (v ~ /M$/) sub("M", "", v)
18
  else if (v ~ /K$/) { sub("K", "", v); v /= 1024 }
18
  else if (v ~ /K$/) { sub("K", "", v);v /= 1024 }
19 19
  else v /= 1024 * 1024;
20 20
  return v;
21 21
}
22 22
function spliter(v, i) {
23
  split(v,a,"/");
23
  split(v, a, "/");
24 24
  return(a[i]);
25 25
}
26 26
/^Memory/ {

Formats disponibles : Unified diff