proc_args example

This commit is contained in:
Doug MacEachern 2007-09-15 21:40:45 +00:00
parent ac6d7b9a81
commit 2a1f3f31f7
1 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,18 @@
require 'rbsigar'
def output(sigar, pid)
args = sigar.proc_args(pid)
exe = sigar.proc_exe(pid);
puts "exe=" + exe.name
puts "cwd=" + exe.cwd
args.each do |arg|
puts " " + "=>" + arg + "<="
end
end
sigar = Sigar.new
ARGV.each do |pid|
output(sigar, pid.to_i)
end