The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
using uniq and awk?? amatuer_lee_3 Shell Programming and Scripting 13 05-17-2008 10:10 AM
Sort, Uniq, Duplicates Amruta Pitkar Shell Programming and Scripting 5 05-16-2007 10:49 PM
Removing duplicates [sort , uniq] sharatz83 Shell Programming and Scripting 4 07-14-2006 02:12 PM
sort and uniq in perl reggiej Shell Programming and Scripting 4 05-18-2006 07:46 PM
Help with Last,uniq, sort and cut jay1228 UNIX for Dummies Questions & Answers 1 02-15-2005 09:33 PM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-17-2002
jimmyflip
Guest
 

Posts: n/a
Stumble this Post!
sort/uniq

I have a file:

Fred
Fred
Fred
Jim
Fred
Jim
Jim

If sort is executed on the listed file, shouldn't the output be?:

Fred
Fred
Fred
Fred
Jim
Jim
Jim

Then if uniq is executed on the sorted file, shouldn't the output be:

4 Fred
3 Jim

I can't get it to work. Any help on this would be appreciated. Thanks.
Forum Sponsor
  #2 (permalink)  
Old 10-17-2002
Registered User
 

Join Date: Jun 2002
Location: Amsterdam (Netherlands)
Posts: 142
Stumble this Post!
Try this

Try this:

`cat <inputfile> | sort | uniq > ><outputfile>` if this give not the correct answer please report your OS-type (`uname -a`).
  #3 (permalink)  
Old 10-17-2002
jimmyflip
Guest
 

Posts: n/a
Stumble this Post!
Hello Janr,

That did not work. The output was:

Fred
Jim

SunOS 5.8 Generic_108528-12 sun4u SUNW, Ultra-Enterprise
  #4 (permalink)  
Old 10-17-2002
jimmyflip
Guest
 

Posts: n/a
Stumble this Post!
Janr, nevermind. I got it!

Thank you kindly.

Jimmy
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:21 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0