Script for real time network traffic per process

Hi All Gurus,

I want to write a script (bash/ksh/csh) which will show real time network traffic ( TCP or UDP ) generated by per process/PID. For both
Linux/AIX system, as nethogs ( Linux package ) shows ?
Any suggestion is MOST welcome.

Thanks in Advance,
Amritendu Das

nettop sounds like exactly what you want, though it's a utility not a script. Not sure if it's been ported to AIX.

nettop/nethogs are the utilities present , but i want to write script, which i can port any unix platform ... nottop/nethogs are not present for all unix flavour

Writing a script that encompasses them all would pretty much mean rewriting nettop for each and every platform. They're not the same.