Created
August 14, 2011 15:25
-
-
Save schallis/1144981 to your computer and use it in GitHub Desktop.
A Portable Bash Function to List Process Hierarchies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parents(){ :(){ | |
read p n <<<`ps -o ppid,comm -p $1 | awk 'NR>1{print $1,$2}'`; | |
echo -e "$1\t$n"; | |
test $1 -ne 0 && : $p; }; | |
: $1; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment