From 6bb47198816e66c58b36752de40289ea7759d37f Mon Sep 17 00:00:00 2001 From: Lars Kruse Date: Mon, 12 Aug 2019 01:38:16 +0200 Subject: [PATCH] Plugin lxc: separate function for title beautification This avoids a bashism. --- plugins/lxc/lxc-multigraph | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/lxc/lxc-multigraph b/plugins/lxc/lxc-multigraph index 2c699538..f97f925f 100755 --- a/plugins/lxc/lxc-multigraph +++ b/plugins/lxc/lxc-multigraph @@ -171,6 +171,13 @@ lxc_count_processes () { } +# change the first character of a string to upper case +title_case() { + local text="$1" + printf "%s%s" "$(echo "$text" | cut -c 1 | tr "[:lower:]" "[:upper:]")" "$(echo "$text" | cut -c 2-)" +} + + # --- BASIC DEFINES active_guests=$(active_guests "$exclude") @@ -204,7 +211,7 @@ EOF for cpu_usage in user system do cat <