The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
unique sort contents of a variable praveenbvarrier Shell Programming and Scripting 2 05-20-2008 04:12 AM
Sort and Unique in Perl deepakwins Shell Programming and Scripting 20 02-11-2008 06:25 PM
Shell script to check the unique numbers in huge data namishtiwari Shell Programming and Scripting 7 08-10-2007 06:38 AM
count data separate by comma bucci Shell Programming and Scripting 10 04-25-2007 08:54 PM
Script to count unique number of user loged in elchalateco Shell Programming and Scripting 1 09-30-2002 08:32 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #8  
Old 05-15-2008
Registered User
 

Join Date: Jan 2007
Posts: 25
for me works..

also you can try:sort HITS | uniq $2 | wc -l


Reply With Quote
Forum Sponsor
  #9  
Old 05-15-2008
Moderator
 

Join Date: Feb 2007
Posts: 2,314
The first 2 also work fine for me:

Code:
cat HITS| awk ' {print $2}' | sort | uniq | wc -l
awk '{print$2}' HITS | sort | uniq | wc -l
Regards
Reply With Quote
  #10  
Old 05-15-2008
Registered User
 

Join Date: May 2008
Posts: 53
apologies to Franklin52, i shall not doubt another post by you again.

it didnt work because for some reason lurking in my script was a }

which is why it wouldnt run.

sorry again
Reply With Quote
  #11  
Old 05-15-2008
 

Join Date: Nov 2007
Location: 45.48-73.63
Posts: 736
Quote:
Originally Posted by alamitab View Post
number of unic lines:
cat file| awk ' {print $2}' | sort | uniq | wc -l
or show the lines:
cat file| awk ' {print $2}' | sort | uniq
UUOC
Code:
sort -fiu file | wc -l
Reply With Quote
  #12  
Old 05-15-2008
Registered User
 

Join Date: Jul 2006
Posts: 189
Code:
awk '{print $2}' 65308.sort.d | uniq -c
Reply With Quote
  #13  
Old 05-15-2008
 

Join Date: Nov 2007
Location: 45.48-73.63
Posts: 736
Thumbs down

Quote:
Originally Posted by aju_kup View Post
Code:
awk '{print $2}' 65308.sort.d | uniq -c
Did you try that? Read the OP request next time!
Reply With Quote
  #14  
Old 05-15-2008
Registered User
 

Join Date: May 2008
Posts: 53
sorry. i will remember that in future.

***************************************thread closed****************************************
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
linux, solaris, ubuntu

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




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


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

Content Relevant URLs by vBSEO 3.2.0