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 -->
  #7 (permalink)  
Old 08-21-2008
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,945
Another way is to set the field separator to ": "

Code:
awk -F": " '$1 ~ /^uuid/ { uuid=$2 };  $1 ~ /^device-config/ && $3 == "/dev/sdc" { print uuid }'  dev.txt