- 
      
- 
        Save mjf/2006042 to your computer and use it in GitHub Desktop. 
    PT - Trace process ID up in the process tree
  
        
  
    
      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
    
  
  
    
  | #! /bin/sh | |
| # PT - Trace process ID up in the process tree | |
| # Copyright (C) 2012 Matous J. Fialka, <http://mjf.cz/> | |
| # Released under the terms of The MIT License | |
| if [ $# -ne 1 ] | |
| then | |
| echo usage: pt pid | |
| exit | |
| fi | |
| if [ $1 -lt 1 ] | |
| then | |
| exit | |
| fi | |
| if ps -o pid= -p $1 | |
| then | |
| $0 `ps -o ppid= -p $1` | |
| fi | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment