LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Shell Script : Finding a duplicate Number from file ? (https://www.linuxquestions.org/questions/programming-9/shell-script-finding-a-duplicate-number-from-file-690148/)

avklinux 12-12-2008 12:21 PM

Shell Script : Finding a duplicate Number from file ?
 
Thanks
AVK linux

w3bd3vil 12-12-2008 01:12 PM

You should probably elaborate on your question. atleast write your question in the post!

acid_kewpie 12-12-2008 04:26 PM

you REALLY aren't making any friends with your multiple accounts and hopelessly vague threads. If you wish to remain a valued member of this site, please use it better.

arunmathew1984 12-14-2008 01:33 AM

Can you elaborate a bit more on your requirements!!!

Linux Archive

acid_kewpie 12-14-2008 02:45 AM

dude, he's been asked twice already, and is probably never coming back to this thread... why bump it??

avklinux 12-15-2008 12:14 PM

Hello Thread
 
Hello ,

i got some comments like i am not using this site in a better way . ?

Moderator can you explain what is my mistake ?

i will not repeat if its really violating the forum policy


Thanks

And iN a question i want ask :

In bash , how can i find a duplicate number from one file .

ex :
file or variable has a following value
1
2
3
4
5
5


so how can i find a duplicate number with shell script in bash.

Thanks
AVKlinux

bgeddy 12-15-2008 12:27 PM

sort file_to_find_dupes | uniq -d

acid_kewpie 12-15-2008 01:10 PM

well no need to use uniq at all, sort has a unique option too, -u i *think*.

and bgeddy, please sort out your signature, it's horrible and is distorting the page layouts from all the -'s

bgeddy 12-16-2008 11:50 AM

Quote:

well no need to use uniq at all, sort has a unique option too, -u i *think*.
Well I took it the OP wanted to output duplicates only so first sort the file then pass it to uniq -d to output duplicates only. Sorting unique just fives a unique list of values.

Quote:

and bgeddy, please sort out your signature, it's horrible and is distorting the page layouts from all the -'s
Sorry about that - ( it's never been mentioned before). Hopefully it's now OK ? :o


All times are GMT -5. The time now is 10:28 PM.