#!/bin/bash
#                       /usr/local/bin/pid2cmd
# http:///crystalfaeries.net/posix/bin/pid2cmd
# celeste:crystalfaery 2015-09-25 18:49:21+00:00
# http://www.commandlinefu.com/commands/view/14739/show-the-command-line-for-a-pid-converting-nulls-to-spaces-and-a-newline
# celeste:crystalfaery 2015-09-27 12:17:26+00:00
# http://www.commandlinefu.com/commands/view/14745/show-the-command-line-for-a-pid-with-ps

while [ $# -ne 0 ]
do
	echo -n "$1: "
#	xargs -0a /proc/$1/cmdline echo
	ps h -o %a $1
	shift
done



syntax highlighted by Code2HTML, v. 0.9.1