2010-01-18 10:26:31 +08:00
|
|
|
require 'sigar'
|
2007-09-16 05:40:45 +08:00
|
|
|
|
|
|
|
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|
|
2009-03-16 03:33:54 +08:00
|
|
|
output(sigar, pid)
|
2007-09-16 05:40:45 +08:00
|
|
|
end
|