Fix comma replacement

This commit is contained in:
Philipp Schmitt 2020-10-20 09:14:41 +02:00
parent b8ac9cac6b
commit f15e7853f4
No known key found for this signature in database
GPG key ID: DC439C47EACB17F9

View file

@ -28,9 +28,6 @@ print_load() {
sub(/,$/, "", $(NF-2));
sub(/,$/, "", $(NF-1));
sub(/,$/, "", $NF);
sub(/,/, ".", $(NF-2));
sub(/,/, ".", $(NF-1));
sub(/,/, ".", $(NF));
printf "%.2f %.2f %.2f", $(NF-2)/num_cores, $(NF-1)/num_cores, $NF/num_cores
}')
@ -44,9 +41,14 @@ print_load() {
15)
output="$(awk '{ print $3 }' <<< "$output")"
;;
*)
echo "Invalid input." >&2
return 2
;;
esac
echo -n "$output"
# Replace commas with dots
echo -n "${output//,/.}"
}
main() {