]> git.ipfire.org Git - thirdparty/lxc.git/commit
lxc-ps: use posix shell and awk instead of bash
authorNatanael Copa <ncopa@alpinelinux.org>
Wed, 26 Dec 2012 21:31:56 +0000 (22:31 +0100)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 2 Jan 2013 18:00:32 +0000 (13:00 -0500)
commitb5dec5f30bdf6137789bd19eee5393ed8b60840e
treea496bdbb2fafefd5c1f1c2c7a9e672730a5a9995
parent600faead3804e7f507e18bdb41588964b0fc611f
lxc-ps: use posix shell and awk instead of bash

Use awk to parse the output pf 'ps' and the tasks files for the
containers.

Use awk fields to find PID column rather than assume that the PID field
is exactly 5 chars wide and has a leading space ' PID'. This works as
long as the PID field is before the command or other field that include
spaces. This also makes it work with busybox 'ps'.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/lxc-ps.in