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 02-17-2009
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,886
It's there to protect the `command` subexpression from being evaluated at the time the alias is created. You want this command to actually run when the alias is executed. The { print $1 } is a tiny awk script which must be quoted to prevent $1 from being evaluated by the shell at run-time.

By the way, you could avoid these funny quotes by using cut:
Code:
set x=`echo $x|cut -d " " -f 1`