On Thu, 13 Dec 2018 20:31:29 +0100 799 <one7tw...@gmail.com> wrote: > Hello Chris, > > On Wed, 12 Dec 2018 at 22:52, Chris Laprise <tas...@posteo.net> wrote: > > > But here's how you could start the loop: > > qvm-ls --running -O name | (read line; while read line; do qvm-run > > -p $line 'your vm command goes here'; done) > > [...] > > > > thanks for the hint. > I tried to run the following command which gives me a list of all > running VMs (just to get the loop right): > qvm-ls --running -O name --raw-data | (read line; while read line; do > echo $line; done) > In my case: > my-untrusted > my-vault > sys-firewall > sys-net > sys-usb > > The command to get the information about the swap usage from a VM > (here named APPVMNAME can be shown by running the following command > in dom0: > > echo APPVMNAME = `qvm-run --pass-io APPVMNAME "free" | tail -n +3 | > gawk '{ print $3 }'` > > But when I bring both peaces together I only get one result back, not > the result for all AppVMs > > qvm-ls --running -O name --raw-data | (read line; while read line; do > echo $line `qvm-run --pass-io $line "free" | tail -n +3 | gawk > '{ print $3 }'` ; done) > > Output in my case: > my-untrusted 256 > > So the output is only showing the output for one VM. > I don't understand why this is happening. > > - O >
Hi, I can't figure out why the code above only returns the first VM's result, but the following code works for me :- for i in `qvm-ls --running -O name --raw-data|grep -v dom0`; do echo $i = `qvm-run --pass-io $i "free"| tail -n +3 | gawk '{print $3 }'`; done Mike. -- You received this message because you are subscribed to the Google Groups "qubes-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to qubes-users+unsubscr...@googlegroups.com. To post to this group, send email to qubes-users@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/qubes-users/20181213205134.7d2dfb82.mike%40keehan.net. For more options, visit https://groups.google.com/d/optout.