[X2Go-Commits] [maintenancescripts] 01/01: killstalevms.bash: use a subprocess instead of a pipe to keep variables.
git-admin at x2go.org
git-admin at x2go.org
Wed Feb 11 23:52:24 CET 2015
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch master
in repository maintenancescripts.
commit 286bd1f6bdc4cf66566a49f04b14e0d858e6018c
Author: Mihai Moldovan <ionic at ionic.de>
Date: Wed Feb 11 23:52:20 2015 +0100
killstalevms.bash: use a subprocess instead of a pipe to keep variables.
---
killstalevms.bash | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/killstalevms.bash b/killstalevms.bash
index 1cd7fa3..5dbc9ea 100644
--- a/killstalevms.bash
+++ b/killstalevms.bash
@@ -7,11 +7,9 @@ typeset -i i
i=0
-pgrep -f -u root '^kvm.*pbuilder.*qemu.*' | while read VM_PID; do
- VM_LIST[$i]="${VM_PID}"
- i=++i
- echo $i
-done
+while read VM_PID; do
+ VM_LIST[$((i++))]="${VM_PID}"
+done < <(pgrep -f -u root '^kvm.*pbuilder.*qemu.*')
typeset -a BUILDER_LIST
--
Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/maintenancescripts.git
More information about the x2go-commits
mailing list