Re: sed question & an echo question
From: Noi (noi_at_siam.com)
Date: Sat, 18 Oct 2003 20:46:16 GMT
On Sat, 18 Oct 2003 13:39:57 +0000, shayne without thinking wrote:
> Noi wrote:
>> On Wed, 15 Oct 2003 05:49:15 +0000, Chris F.A. Johnson without thinking
>> > On Tue, 14 Oct 2003 at 23:11 GMT, Paul Lutus wrote:
>> >> shayne wrote:
>> Thanks for the tips. Questions:
>> Except that the OP wanted to learn sed what would be wrong with rpm
>> -Uvh *.rpm ? after saving rpms to a folder? Otherwise he'd have to
>> maintain a list of *.rpms.
>> Doesn't -U upgrade existing and add new packages?
> On a CD-RW I have the latest rpm updates released by mandrake. I make a
> with the list of filenames ls /mnt/cdrom >/filelist and add rpm -Uvh to
> beginning of each line on this file. I manually edit this file to
> exclude any
> updates I don't need, make this file executable and run it to update my
> packages. Instead of rpm -Uvh, I could use rpm -Fvh which only updates
> the packages that are installed. I don't know if it's the best way to
> update the
> packages but it works for me. I hope everyone has a nice weekens.
Well, you could just cd to the CDrom and rpm -Uvh *.rpm and that would
take care of the upgrades.
However, Chris and the others are providing excellent tips for scripting
an install or upgrade. Incorporating their suggestions into your script
for building a file of new and updated rpms would go a long way to
improving your shell scripting knowledge. A purpose for writing scripts
is to automate routine tasks so you don't have to write the script again.
I suggest you should continue improving your script to mount the CDRom, create
the list of rpms on the CD, and then update -Uvh those rpms from the CD,
maybe later include code to skip those rpms that haven't changed.