From afde14b731e4468dc182f6aeb1eb6665ebcd38e3 Mon Sep 17 00:00:00 2001 From: Jakub Wadolowski Date: Fri, 16 Jan 2015 16:10:26 +0100 Subject: [PATCH] Fix for OSGi bundles listing (incorrect total and missing last line). Fix has been partially implemented in response to issue #17. --- cqosgi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cqosgi b/cqosgi index 6f968b3..662baec 100755 --- a/cqosgi +++ b/cqosgi @@ -65,7 +65,7 @@ symbolicName\":\"([^\"]+)\",\"category\":\"([^\"]*)\".*" items=$(printf "%s" "${filtered_items}" \ | ${SEDX} "s#${REGEXP}#\1${TB}\6${TB}\4${TB}\5${TB}\2#"\ | sort -nk1 -t "${TB}") - total=$(printf "%s" "${items}" | wc -l | tr -d ' ') + total=$(printf "%s\n" "${items}" | wc -l | tr -d ' ') if [ "${machine_friendly}" -eq 0 ] then printf "%s bundles\n\n" "${total}" @@ -76,7 +76,7 @@ symbolicName\":\"([^\"]+)\",\"category\":\"([^\"]*)\".*" fi if [ "${machine_friendly}" -eq 1 ] then - printf "%s" "${output}" + printf "%s\n" "${output}" else COLUMN=$(which column) if [ ${?} -ne 0 -o -z "${COLUMN}" ] @@ -84,7 +84,7 @@ symbolicName\":\"([^\"]+)\",\"category\":\"([^\"]*)\".*" echo "Cannot find column utility" >&2 exit 1 fi - printf "%s" "${output}" | tr '\t' "${SEP}" | ${COLUMN} -xt -c 5 \ + printf "%s\n" "${output}" | tr '\t' "${SEP}" | ${COLUMN} -xt -c 5 \ -s "${SEP}" 2>/dev/null fi }