提交 2bbda144 编写于 作者: P Philipp Hahn 提交者: Eric Blake

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: NPhilipp Hahn <hahn@univention.de>
上级 a757e60a
......@@ -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"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册