Teresa and Dale <[EMAIL PROTECTED]> writes:

>
>
> Thanks, read the man page, it was short so it didn't take long.  I tried
> this:
>
> uniq -u /home/dale/Desktop/hosts /home/dale/Desktop/hostsort
>
> It doesn't look like it did anything but copy the same thing over. 
> There are only 2 lines missing.  Does spaces count?  Some put in a lot
> of spaces between the localhost and the web address.  Maybe that has a
> affect??

The problem with uniq is that it (according to the manpage),

  "Discard all but one of successive identical lines"

You need to have a sorted file for uniq to do what you want, or sort
it with the -u  option

  sort -u hosts > hostsort

If you don't want to ruin your original order you have to do something
else. This is one way of doing it with perl.

  perl -ne 'print unless exists $h{$_}; $h{$_} = 1' hosts > hostsort

--
 Christer

-- 
gentoo-user@gentoo.org mailing list

Reply via email to