Mercurial > public > ssdt-docker
diff scripts/pid2name.sh @ 75:aa2fd199ba56
improve pid2name script
author | smith@nwoca.org |
---|---|
date | Wed, 23 Mar 2016 16:39:31 +0100 |
parents | 334d65dac778 |
children |
line wrap: on
line diff
--- a/scripts/pid2name.sh Wed Mar 23 16:37:35 2016 +0100 +++ b/scripts/pid2name.sh Wed Mar 23 16:39:31 2016 +0100 @@ -1,4 +1,5 @@ #!/bin/bash +# determines the docker container name of a PID on docker host. docker ps -q | xargs docker inspect --format '{{.State.Pid}} {{.Name}}' \ - | grep "^$1" | sed 's/^.*\///g' + | grep "^${1?specify pid of process on host}" | sed 's/^.*\///g'