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 -->
  #3 (permalink)  
Old 08-20-2007
summer_cherry summer_cherry is offline
Registered User
 

Join Date: Jun 2007
Location: Beijing China
Posts: 557
hi

Try follow one, use awk array to remember the appearance of the line:

Code:
awk '{
 if (arr[$0]=="")
 arr[$0]=1
 }
 END{
 for (i in arr)
 print i
 }' filename
Reply With Quote