From 03f0b4db9fc49f0c888d469ed142ed89233f08c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Ruffet?= Date: Wed, 5 Jun 2019 12:03:06 +0200 Subject: [PATCH] Account for spaces in repository label (#1348) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémy Ruffet --- text_collector_examples/apt.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/text_collector_examples/apt.sh b/text_collector_examples/apt.sh index b78d38e0..171bb0aa 100755 --- a/text_collector_examples/apt.sh +++ b/text_collector_examples/apt.sh @@ -6,8 +6,8 @@ upgrades="$(/usr/bin/apt-get --just-print upgrade \ | /usr/bin/awk -F'[()]' \ - '/^Inst/ { sub("^[^ ]+ ", "", $2); sub("\\[", " ", $2); - sub(" ", "", $2); sub("\\]", "", $2); print $2 }' \ + '/^Inst/ { sub("^[^ ]+ ", "", $2); gsub(" ","",$2); + sub("\\[", " ", $2); sub("\\]", "", $2); print $2 }' \ | /usr/bin/sort \ | /usr/bin/uniq -c \ | awk '{ gsub(/\\\\/, "\\\\", $2); gsub(/\"/, "\\\"", $2);