On Thu, Mar 10, 2016 at 03:01:01PM +0700, Fajar A. Nugraha wrote:
> On Thu, Mar 10, 2016 at 2:47 PM, Stéphane Graber <stgra...@ubuntu.com> wrote:
> > On Thu, Mar 10, 2016 at 02:37:47PM +0700, Fajar A. Nugraha wrote:
> >> On Thu, Mar 10, 2016 at 11:20 AM, Mark Constable <ma...@renta.net> wrote:
> >> >
> >> > I'm not sure if this is already possible but a suggestion for lxc list
> >> > would be to provide a "clean" output option without ascii borders. Using
> >> > mysql as an example it would be neat if something like this was 
> >> > possible...
> >> >
> >> > [[ $(lxc list $HOST -BN -cs) = RUNNING ]] && echo yay || echo nay
> 
> 
> >> Is there a particular reason you can't work with what's currently 
> >> available?
> >>
> >> # lxc-ls -1 --running
> >> api
> 
> 
> > Because he's using LXD, those tools don't work with LXD containers.
> 
> Ooops :)
> 
> "lxc help list" doesn't provide any equivalent of "lxc-ls -1" or
> "--running", so the closest equivalent right now would be to parse the
> output? Or is there a better way?

We've had a few folks ask for a --format option of some sort which would
allow them to get the info in csv, tabular or json/yaml format.

This would be a good addition but so far nobody stepped up to actually
implement it...

https://github.com/lxc/lxd/issues/882

> 
> # lxc list -c ns | awk '$4~/RUNNING/ {print $2}'
> xenial
> 
> -- 
> Fajar
> _______________________________________________
> lxc-users mailing list
> lxc-users@lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com

Attachment: signature.asc
Description: PGP signature

_______________________________________________
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Reply via email to