On Wed, 2006-06-21 at 08:15 -0400, William L. Maltby wrote:
On Wed, 2006-06-21 at 05:47 -0500, Johnny Hughes wrote:
On Tue, 2006-06-20 at 22:32 +0300, Kari Salovaara wrote:
<snip>
After rebooting on a new kernel, I remove the ones I don't want to save by doing:
rpm -qa | grep kernel | sort
<snip>
Why not this,
rpm -qa kernel\*|sort # Laziness trumping readability here, no # spaces. But that's not my main point.
instead of what you demonstrate. I tried it on my own (admittedly
<snip>
Well, I haven't dug heavily into the docs, but ran a small quick test while investigating a "fubar'd rpm db" that Karan and Ralph caught. There does appear a difference in output in the two styles of rpm query, depending on install at this limited stage of investigation. Is it an advantage or disadvantage? POV/immediate need will determine that I quess.
My lazy version first.
[root@wlmlfs08 ~]# rpm -qa rpm* | sort >/tmp/tmp ; cat /tmp/tmp rpm-4.3.3-11_nonptl.i386 rpm-4.3.3-13_nonptl.i386 rpm-build-4.3.3-11_nonptl.i386 rpm-build-4.3.3-13_nonptl.i386 rpmdb-CentOS-4.2-0.20051011.i386 rpmdb-CentOS-4.3-0.20060314.i386 rpm-devel-4.3.3-11_nonptl.i386 rpm-devel-4.3.3-13_nonptl.i386 rpmforge-release-0.3.4-1.el4.rf.i386 rpm-libs-4.3.3-11_nonptl.i386 rpm-libs-4.3.3-13_nonptl.i386 rpm-python-4.3.3-11_nonptl.i386 rpm-python-4.3.3-13_nonptl.i386 [root@wlmlfs08 ~]#
The suggested version next and a diff at the end.
[root@wlmlfs08 ~]# rpm -qa|grep rpm|sort >/tmp/tmp2;cat /tmp/tmp2; \
diff /tmp/tmp /tmp/tmp2
redhat-rpm-config-8.0.32.1-1.noarch rpm-4.3.3-11_nonptl.i386 rpm-4.3.3-13_nonptl.i386 rpm-build-4.3.3-11_nonptl.i386 rpm-build-4.3.3-13_nonptl.i386 rpmdb-CentOS-4.2-0.20051011.i386 rpmdb-CentOS-4.3-0.20060314.i386 rpm-devel-4.3.3-11_nonptl.i386 rpm-devel-4.3.3-13_nonptl.i386 rpmforge-release-0.3.4-1.el4.rf.i386 rpm-libs-4.3.3-11_nonptl.i386 rpm-libs-4.3.3-13_nonptl.i386 rpm-python-4.3.3-11_nonptl.i386 rpm-python-4.3.3-13_nonptl.i386 0a1
redhat-rpm-config-8.0.32.1-1.noarch
[root@wlmlfs08 ~]#
The grep version has the (dis?)advantage of including things not directly a part of the hunt we were conducting. So for scripting purposes, it seems that the grep version may have some caveats. But for "hoomon" investigation, this may be a desirable feature.
This doesn't definitively answer my Q, but gives me an optimism that the abbreviated form I use a *lot* may be safe. A look at the docs should confirm. I'll not post on this again unless I see something different.
<snip sig stuff>