Hey Kristof, sorry if your question has been answered but I saw this post and 
decided to respond anyway. I had a similar question which resulted in the 
script below. I hope this helps you.
-------------------------------begin script
#!/bin/ksh
# get process id for port
line='-------------------------------------------------------------------------'
pids=`/usr/bin/ps -ef | sed 1d | awk '{print $2}'`
if [ $# -eq 0 ]; then
         read ans?"Enter port you like to know pid for: "
else
         ans=$1
fi
for f in $pids
do
         /usr/proc/bin/pfiles $f 2>/dev/null | /usr/xpg4/bin/grep -q "port: 
$ans"
         if [ $? -eq 0 ] ; then
                 echo "$line\nPort: $ans is being used by PID: \c"
                 /usr/bin/ps -o pid -o args -p $f | sed 1d
         fi
done
exit 0
----------------------------end script
-- 
This message posted from opensolaris.org
_______________________________________________
dtrace-discuss mailing list
dtrace-discuss@opensolaris.org

Reply via email to