comparison .bashrc @ 103:e841c419199e

add process command to get filehandles
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 01 Nov 2010 13:44:46 -0700
parents 35d28c0a6ba3
children bf567a0e8fef
comparison
equal deleted inserted replaced
102:35d28c0a6ba3 103:e841c419199e
146 # make a temporary file 146 # make a temporary file
147 tmpfile() { 147 tmpfile() {
148 148
149 if [ "$#" == "0" ] 149 if [ "$#" == "0" ]
150 then 150 then
151 args="." 151 args="tmp"
152 else 152 else
153 args=$@ 153 args=$@
154 fi 154 fi
155 155
156 for i in $args 156 for i in $args
310 rm -rf "${i}" 310 rm -rf "${i}"
311 fi 311 fi
312 done 312 done
313 } 313 }
314 314
315 filehandles() {
316 TMPFILE=$(tmpfile)
317 ps -e|grep -v TTY|awk {'print "echo -n \"Process: "$4"\tPID: "$1"\tNumber of FH: \"; lsof -p "$1"|wc -l"'} > ${TMPFILE}
318 . ${TMPFILE} | sort
319 rm ${TMPFILE}
320 }
321
315 ### include overrides for commands 322 ### include overrides for commands
316 source ~/.bash_overrides 323 source ~/.bash_overrides
317 324
318 ### regenerate fluxbox menus here for convenience 325 ### regenerate fluxbox menus here for convenience
319 MENU=~/web/site/programs.html 326 MENU=~/web/site/programs.html