Commit 7dd7a413 authored by Matthieu Muffato's avatar Matthieu Muffato
Browse files

bugfix: now works if the lines in the bacct output do not start with a space

parent 530e31c6
......@@ -116,8 +116,8 @@ sub main {
}
}
my (@keys) = split(/\s+/, $lines[@lines-2]);
my (@values) = split(/\s+/, $lines[@lines-1]);
my (@keys) = split(/\s+/, ' '.$lines[@lines-2]);
my (@values) = split(/\s+/, ' '.$lines[@lines-1]);
my %usage = map { ($keys[$_] => $values[$_]) } (0..@keys-1);
my ($mem) = $usage{MEM} =~ /^(\d+)[KMG]$/;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment