[EMAIL PROTECTED] wrote:

> I am trying to combine a few commands to download and update
> rpm packages automatically. Now, I know I can use autorpm and
> a few other packages to do this, but I would like to use this
> as a learning opportunity.
>
> So far I am using wget to get the list of updates and sed and
> cut to get the names from the file listing. My question is that
> I now have a list of all the files sorted, but this list has
> multiple versions of the same package. For example:
>
> ...
> kernel-2.2.14-12.i386.rpm
> kernel-2.2.14-6.0.1.i386.rpm
> kernel-2.2.14-6.1.1.i386.rpm
> ...
>
> How do I get a list of only the newest version of each package
> listed.
>

What does ls -t do?  It should sort by modification time of the files.
Then, if yopu are really tricky, you can figure out when the list begins
to repeat.

Just a suggestion I have not tried.  MY gues is that this would be a good
time to learn perl :)

Bret


-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.

Reply via email to