Permalink
Browse files

deletet unnecessary output "\n"

Output looked like this:

root@htpc:/etc/munin/plugins# ./nvidia_gpu_mem
mem0.value 0\n
  • Loading branch information...
CWempe committed Feb 12, 2013
1 parent a3dadfa commit 7688a3f5ba982ae3421335a5e0fbf6798889d90d
Showing with 1 addition and 1 deletion.
  1. +1 −1 plugins/gpu/nvidia_gpu_
View
@@ -180,7 +180,7 @@ case $name in
totalMemGpu=`echo "$totalMemGpus" | sed -n $(( $nGpusCounter + 1 ))p`
usedMemGpu=`echo "$usedMemGpus" | sed -n $(( $nGpusCounter + 1 ))p`
percentMemUsed=$(( $usedMemGpu * 100 / $totalMemGpu ))
- valueGpus="${valueGpus}${percentMemUsed}\n"
+ valueGpus="${valueGpus}${percentMemUsed}"
: $(( nGpusCounter = $nGpusCounter + 1 ))
done
;;

1 comment on commit 7688a3f

Contributor

leeclemens commented on 7688a3f Jan 24, 2014

The intention of the newline is correct. Running on RHEL 6.5 with multile GPUs, the output does not include a newline character, causing the issue I resolved in 7713329 to effectively append the newline (as required for the subsequent iteration of $valueGpus with sed -n to function as expected - which reads the value from multiple lines)

Please sign in to comment.