Re: Regex parsable output of systemctl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Di, 18.12.18 11:15, Mantas Mikulėnas (grawity@xxxxxxxxx) wrote:

> On Tue, Dec 18, 2018 at 11:09 AM Thomas Güttler
> <guettliml@xxxxxxxxxxxxxxxxxx> wrote:
> >
> > Hi,
> >
> > to get a regex parsable output of systemctl, I use this up to now:
> >
> >      systemctl list-units --full --all --plain --no-legend
> >
> > This is a lot of typing.
> >
> > AFAIK there is no way to make it shorter (maybe use -a instead of --all).
> >
> > Maybe I am blind and there is already a switch which makes the output
> > of systemctl easy to parse in scripts.
> >
> > If there is no such switch up to now, then it would be very nice if
> > it could be added.
>
> Having a JSON output mode for the table would be nice (at least for
> DBus-incapable shell scripts). You could then feed that to `jq`.

Note that the upcoming systemd 240 has that for a number of tools, for
example "loginctl". However it's still missing for the most relevant
tool "systemctl", that that's because noone ported its table
formatting logic over to the format-table.c implementation we have
now, which deals with all of this and can do JSON output.

Lennart

--
Lennart Poettering, Red Hat
_______________________________________________
systemd-devel mailing list
systemd-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux