From: paulfantom Date: Tue, 7 Jun 2016 22:29:31 +0000 (+0200) Subject: reset IFS to previous one X-Git-Tag: v1.3.0~155^2~1 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netdata.git;a=commitdiff_plain;h=3b75b49d6a47e1f20d630c857ad89d7322f1599a reset IFS to previous one --- diff --git a/charts.d/hddtemp.chart.sh b/charts.d/hddtemp.chart.sh index 704ab9d0..91bac6cf 100755 --- a/charts.d/hddtemp.chart.sh +++ b/charts.d/hddtemp.chart.sh @@ -41,9 +41,11 @@ hddtemp_count=0 hddtemp_update() { # local all=( `nc $hddtemp_host $hddtemp_port | sed -e 's/||/\n/g;s/^|//' | cut -d '|' -f3` ) # local all=( `nc $hddtemp_host $hddtemp_port | awk 'BEGIN { FS="|" };{i=4; while (i <= NF) {print $i+0;i+=5;};}'` ) + OLD_IFS=$IFS set -f IFS="|" all=( $(nc $hddtemp_host $hddtemp_port) ) set +f + IFS=$OLD_IFS # write the result of the work. echo "BEGIN hddtemp.temperature $1"