From 4ed49e73fb76101d421f0488b644f88d3d541712 Mon Sep 17 00:00:00 2001 From: Shevchenko Vitaliy Date: Wed, 24 Jan 2018 12:35:14 +0200 Subject: [PATCH] Escape double quotes in device model family (#772) --- text_collector_examples/smartmon.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text_collector_examples/smartmon.sh b/text_collector_examples/smartmon.sh index ad6182e6..61fdce34 100755 --- a/text_collector_examples/smartmon.sh +++ b/text_collector_examples/smartmon.sh @@ -74,7 +74,7 @@ parse_smartctl_info() { local model_family='' device_model='' serial_number='' fw_version='' vendor='' product='' revision='' lun_id='' while read line ; do info_type="$(echo "${line}" | cut -f1 -d: | tr ' ' '_')" - info_value="$(echo "${line}" | cut -f2- -d: | sed 's/^ \+//g')" + info_value="$(echo "${line}" | cut -f2- -d: | sed 's/^ \+//g' | sed 's/"/\\"/')" case "${info_type}" in Model_Family) model_family="${info_value}" ;; Device_Model) device_model="${info_value}" ;;