The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 -->
  #2 (permalink)  
Old 09-28-2006
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,724
That's because the shell treat $6 as a commandline variable - it doesn't see the awk block and know it's an awk command:
Code:
$ export DEV="/usr/sbin/diskutil list | /usr/bin/grep Master | /usr/bin/awk '{ print \$6 }'"
FWIW - what you want here is probably an alias unless you plan to :
Code:
eval $DEV