Mercurial > hg > config
comparison .bashrc @ 709:c24a1b531b7e
move isrunning to a shell script and kill killbyname since there is pkill nowadays
| author | Jeff Hammel <k0scist@gmail.com> | 
|---|---|
| date | Fri, 05 Sep 2014 14:55:11 -0700 | 
| parents | 9afe2373aaa2 | 
| children | 1337d2e9e1a6 | 
   comparison
  equal
  deleted
  inserted
  replaced
| 708:fa6c6f64e12b | 709:c24a1b531b7e | 
|---|---|
| 316 FILE=$1 | 316 FILE=$1 | 
| 317 shift | 317 shift | 
| 318 emacs +`wc -l "$FILE"` $@ | 318 emacs +`wc -l "$FILE"` $@ | 
| 319 } | 319 } | 
| 320 | 320 | 
| 321 | |
| 322 ### functions for processes | |
| 323 | |
| 324 isrunning() { | |
| 325 # is a process running? (by name) | |
| 326 # see also: talos for a better version | |
| 327 for i in "$@" | |
| 328 do | |
| 329 ps axwww | grep "$i" | grep -v 'grep' | |
| 330 done | sort | uniq | |
| 331 | |
| 332 } | |
| 333 | |
| 334 killbyname() { | |
| 335 # kill a process by name | |
| 336 kill `isrunning "$@" | awk '{ print $1 }' | onelineit.py` | |
| 337 } | |
| 338 | |
| 339 ### | 321 ### | 
| 340 | 322 | 
| 341 buffer() { | 323 buffer() { | 
| 342 # temporary buffer with cat and /dev/null | 324 # temporary buffer with cat and /dev/null | 
| 343 cat > /dev/null | 325 cat > /dev/null | 
