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 -->
  #1 (permalink)  
Old 05-29-2007
jfortes jfortes is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 6
Angry Define an alias with an embeded awk command ??

Hi all,

I'm trying to define an alias with an embeded awk command:

alias kpipe='kill `psme| grep "ifw -r" | grep -v "grep ifw -r"| awk '{print $2}'`'

The problem is that the awk command (awk '{print $2}') contains two ' ..' quotes. So bash assumes that the first awk quote corresponds to the end of the alias, but it's not. I want it to process till the last ' .

How do I do it ? Any help will be highly appreciated.

note: I'm using bash shell.

Thanks for you help.