"yum --partial" feature as a bash line

Wil Cooley wcooley at nakedape.cc
Tue Dec 13 23:37:29 UTC 2005


On Sun, 2005-12-11 at 12:24 +0100, cybernet at interia.pl wrote:

> # get a list of items
> # remove 4 lines from top  (tac/head/tac)
> # try to update one item at a time
> for k in `yum list updates | awk '{ print $1 }' | tac | head -n-4 | 
> tac`; do yum -y update
> $k; done

UUOTac?  Try "sed '1,4d'" instead of the tac|head|tac stuff.  Or better,
use an awk range to filter the output:

awk '/^Setting up/,/^Updated Packages/{next};{print $1}'

Although this might be better, because it could be used with '-e 0 -d 0'
consistently:

awk 'FNR==1,/^Updated Packages/ {next}; {print}'

Wil
-- 
Wil Cooley <wcooley at nakedape.cc>
Naked Ape Consulting, Ltd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/fedora-devel-list/attachments/20051213/43a66bed/attachment.sig>


More information about the fedora-devel-list mailing list