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 UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #7 (permalink)  
Old 08-07-2007
reborg's Avatar
reborg reborg is online now
Administrator
 

Join Date: Mar 2005
Location: Ireland
Posts: 3,816
Code:
awk -F: 'FNR==NR { 
              users[$2] 
         } 
         FNR != NR { 
              if ( $1 in users ) { 
                   next 
              } else { 
                   print $1 
              }
         }' <userfile> /etc/passwd
Reply With Quote