proc_env example
This commit is contained in:
		
							parent
							
								
									2a1f3f31f7
								
							
						
					
					
						commit
						59a4e8d773
					
				
							
								
								
									
										14
									
								
								bindings/ruby/examples/penv.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								bindings/ruby/examples/penv.rb
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,14 @@
 | 
			
		||||
require 'rbsigar'
 | 
			
		||||
 | 
			
		||||
def output(sigar, pid)
 | 
			
		||||
  env = sigar.proc_env(pid)
 | 
			
		||||
  env.each do |key, val|
 | 
			
		||||
    puts key + "=" + val
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
sigar = Sigar.new
 | 
			
		||||
 | 
			
		||||
ARGV.each do |pid|
 | 
			
		||||
  output(sigar, pid.to_i)
 | 
			
		||||
end
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user