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




Thread: NAWK question
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 01-28-2008
DeltaX DeltaX is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 16
NAWK question

Hello everybody !!

I just started messing around with NAWK/AWK and I find it very interesting. I was trying to have script that prints only the the different lines (lines that are identical and adjacent, some that are identical and not adjacent, and some that are just different)

I tried direclty using the command line (awk '$1 != previous { print; previous = $1 }' file)

I am trying to do it in a script.

Your help will be appreciated