The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 05-30-2007
aigles's Avatar
aigles aigles is offline Forum Advisor  
Registered User
  
 

Join Date: Apr 2004
Location: Bordeaux, France
Posts: 1,426
Code:
alias kpipe='kill `psme| grep "ifw -r" | grep -v "grep ifw -r"| awk "{print \\$2}"`'
or
Code:
alias kpipe="kill \`psme| grep 'ifw -r' | grep -v 'grep ifw -r'| awk '{print \$2}'\`"
You can simplify a little bit your command :
Replace
Code:
grep "ifw -r" | grep -v "grep ifw -r"
by
Code:
grep "[i]fw -r"
Another simplification : group grep and awk in a single awk command :
Code:
awk "/[i]ifw -r/ { print \\$2 }"
Jean-Pierre.