Go Job Hunting at the LQ Job Marketplace
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


Search this Thread
Old 11-19-2012, 12:14 AM   #1
Senior Member
Registered: Jun 2006
Location: Debian Land
Posts: 1,335

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


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?

 cat list.txt >> "$varlist"
thank you in advance
Old 11-19-2012, 01:03 AM   #2
Senior Member
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 4,734

Rep: Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264
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, 08:01 AM   #3
Senior Member
Registered: Jan 2011
Distribution: Undecided
Posts: 3,320
Blog Entries: 5

Rep: Reputation: 784Reputation: 784Reputation: 784Reputation: 784Reputation: 784Reputation: 784Reputation: 784
what are "dubblets"?

This may help?

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


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-24-2011 11:15 PM
C++ List iteration and updating list items x_terminat_or_3 Programming 7 03-24-2009 03:02 PM
Adding Items To Katapult cmnorton Ubuntu 1 04-17-2008 06:09 AM
Adding Menu Items hiteshmaisheri Linux - Software 3 04-09-2004 04:41 AM
Adding menu items seeone Slackware 2 12-15-2003 09:51 PM

All times are GMT -5. The time now is 11:31 AM.

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