# HG changeset patch # User smith@nwoca.org # Date 1458747571 -3600 # Node ID aa2fd199ba566da8bed2d5fd52be92e1448b3f5c # Parent 541766977a1123515980606ad36ec51f89ae3080 improve pid2name script diff -r 541766977a11 -r aa2fd199ba56 scripts/pid2name.sh --- 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'