LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 11-19-2012, 01:14 AM   #1
Xeratul
Senior Member
 
Registered: Jun 2006
Location: Debian Land
Posts: 1,389

Rep: Reputation: 88
bash: adding new items to a list


Hi,

I would like to add some new items from list.txt to a given file. However I would like that no dubblets (line check) exists. It is a txt.

Would you mind helping to know how to remove the possible dubblets?

Code:
 cat list.txt >> "$varlist"
thank you in advance
 
Old 11-19-2012, 02:03 AM   #2
pan64
Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 5,142

Rep: Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364
is this list sorted? In that case you can use sort -u. Otherwise you will need a script (perl/awk/whatever)
 
Old 11-19-2012, 09:01 AM   #3
Habitual
Senior Member
 
Registered: Jan 2011
Distribution: Undecided
Posts: 3,618
Blog Entries: 1

Rep: Reputation: Disabled
what are "dubblets"?

This may help?
http://www.linuxquestions.org/questi...ml#post3572599

Last edited by Habitual; 11-19-2012 at 09:05 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] need help adding letters to beginning of words from list using perl,bash or awk enteptain Programming 2 08-25-2011 12:15 AM
C++ List iteration and updating list items x_terminat_or_3 Programming 7 03-24-2009 04:02 PM
Adding Items To Katapult cmnorton Ubuntu 1 04-17-2008 07:09 AM
Adding Menu Items hiteshmaisheri Linux - Software 3 04-09-2004 05:41 AM
Adding menu items seeone Slackware 2 12-15-2003 10:51 PM


All times are GMT -5. The time now is 08:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration