systemctl: hide first column with --plain instead of --no-legend

Hiding the first column, which may contain bullet circles, with --no-legend
is undocumented and potentially unexpected. On the other hand, not printing
bullet circles with --plain is documented so hiding the column with that
switch is sensible.

The combination "--full --no-legend --no-pager --plain" is appropriate for
automated processing of systemctl output.
This commit is contained in:
Jouke Witteveen
2020-04-17 19:15:49 +02:00
committed by Lennart Poettering
parent 75dff0f910
commit 1cabd2d0c5
10 changed files with 16 additions and 12 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ __get_machines() {
}
__get_services() {
systemctl list-units --no-legend --no-pager -t service --all $1 | \
systemctl list-units --no-legend --no-pager --plain -t service --all $1 | \
{ while read -r a b c; do [[ $b == "loaded" ]]; echo " $a"; done }
}