Add some debugging functions
This commit is contained in:
		
							parent
							
								
									253a43b45b
								
							
						
					
					
						commit
						d45f674711
					
				
					 2 changed files with 18 additions and 0 deletions
				
			
		
							
								
								
									
										13
									
								
								functions/parent-user
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								functions/parent-user
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,13 @@ | |||
| function parent-user() { | ||||
|     pid=${1:-$$} | ||||
|     uid=${2:-$(piduser $pid)} | ||||
|     stat=($(</proc/${pid}/stat)) | ||||
|     ppid=${stat[4]}; echo $ppid | ||||
|     puid=$(piduser $ppid ) | ||||
| 
 | ||||
|     if [[ ${puid} != $uid ]]; then | ||||
|         echo ${puid} | ||||
|     elif [[ $ppid != 1 ]]; then | ||||
|         parent-user ${ppid} | ||||
|     fi | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 crater2150
						crater2150