From 2bbda1444dc12b2b7337f8faca12299978111a15 Mon Sep 17 00:00:00 2001 From: Philipp Hahn Date: Tue, 1 Mar 2011 18:57:01 +0100 Subject: [PATCH] libvirt-guest.init: handle domain name with spaces awk splits the line on consecutive spaces, which breaks getting the name of a domain whose name contains spaces. Use sed instead to strip the "Name:" prefix from the line Signed-off-by: Philipp Hahn --- tools/libvirt-guests.init.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libvirt-guests.init.sh b/tools/libvirt-guests.init.sh index 8823d06e14..ea2189e1aa 100644 --- a/tools/libvirt-guests.init.sh +++ b/tools/libvirt-guests.init.sh @@ -105,7 +105,7 @@ guest_name() { uuid=$2 name=$(run_virsh_c $uri dominfo $uuid 2>/dev/null | \ - awk '/^Name:/{print $2}') + sed -ne 's/^Name: *//p') [ -n "$name" ] || name=$uuid echo "$name"