I have a list of names like so:
dog_bone
dog_collar
dragon
cool_dragon
lion
lion_trainer
dog
I need to extract out names that appear in other names like so:
dragon
lion
dog
I looked through the uniq
man page, but it seems to compare entire lines, not strings. Is there a way to do this with a bash function?
dog
,dog_bone
, anddog_bones
all appear in the file, what should be printed out? – Mark Plotnick May 07 '14 at 17:43dog
anddog_bone
would be printed out. – Question Overflow May 08 '14 at 03:39