Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- NOWDIR=`pwd`
- PROCNAME="$1"
- PROCPID=`pidof "$PROCNAME"`
- echo "$PROCPID"
- IFS=' ' read -ra my_array <<< "$PROCPID"
- cd /
- cd proc/
- for i in "${my_array[@]}"
- do
- #echo "$i"
- cd "$i"/fd
- echo NAME = "$PROCNAME" "|" PID = "$i" "|" FILES = `ls | wc -l`
- cd ../../
- done
- #echo NAME = "$PROCNAME" "|" PID = "$PROCPID" "|" FILES = `ls | wc -l`
- cd ~
- #cd "$NOWDIR"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement