#!/usr/bin/tclsh

set pid [ lrange $argv 0 0 ]
set statfd [ open "|grep Vm /proc/$pid/status" ] 
set statline [ gets $statfd ]
if { $statline != "" } then {
  close $statfd
  puts "\nMemory Usage:\n"
  puts [ exec head -13 /proc/$pid/status | tail -7 ] 
}
