reset IFS to previous one
paulfantom committed
Jun 8, 2016 at 00:29 UTC
3b75b49d6a47e1f20d630c857ad89d7322f1599a
1 file changed
+2
charts.d/hddtemp.chart.sh
+2
@@ -41,9 +41,11 @@ hddtemp_count=0
41
hddtemp_update() {
42
# local all=( `nc $hddtemp_host $hddtemp_port | sed -e 's/||/\n/g;s/^|//' | cut -d '|' -f3` )
43
# local all=( `nc $hddtemp_host $hddtemp_port | awk 'BEGIN { FS="|" };{i=4; while (i <= NF) {print $i+0;i+=5;};}'` )
44
+ OLD_IFS=$IFS
45
set -f
46
IFS="|" all=( $(nc $hddtemp_host $hddtemp_port) )
47
set +f
48
+ IFS=$OLD_IFS
49
50
# write the result of the work.
51
echo "BEGIN hddtemp.temperature $1"