changeset 75:aa2fd199ba56

improve pid2name script
author smith@nwoca.org
date Wed, 23 Mar 2016 16:39:31 +0100
parents 541766977a11
children aacc99e52f5e
files scripts/pid2name.sh
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
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'