Re: Getting rpm update history with wildcarding

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Richard Shaw wrote:
> On Thu, Jun 14, 2018 at 8:55 AM Robert Moskowitz <rgm@xxxxxxxxxxxxxxx>
> wrote:
> 
>>
>> On 06/14/2018 09:08 AM, Ahmad Samir wrote:
>>> FWIW, to match using a wildcard you'd have to use `rpm -qa pulseaudio*`.
>>
>> Don't think so:
>>
>> # `rpm -qa pulseaudio*`
>> bash: pulseaudio-module-bluetooth-11.1-18.fc28.1.x86_64: command not found
> 
> Don't include the tick marks, it tried to execute what's inside... What he
> means is that rpm doesn't accept wildcards so if you want to find partial
> matches, you need to pipe it to grep...
> 
> # rpm -qa | grep pulseaudio

I don't think Ahmad was saying that "rpm doesn't accept
wildcards" at all.  Quite the opposite; rpm accepts
wildcards, and has for as long as I can remember.

$ rpm -qa 'pulseaudio*'
pulseaudio-gdm-hooks-11.1-15.fc27.x86_64
pulseaudio-utils-11.1-15.fc27.x86_64
pulseaudio-module-x11-11.1-15.fc27.x86_64
pulseaudio-11.1-15.fc27.x86_64
pulseaudio-libs-glib2-11.1-15.fc27.x86_64
pulseaudio-module-bluetooth-11.1-15.fc27.x86_64
pulseaudio-libs-11.1-15.fc27.x86_64

You need to use the -a / --all option when querying with a
glob, e.g. rpm -qa 'foo*' instead of rpm -q 'foo*'.

Whether you prefer to use a glob or pipe to grep is a matter
of preference in most cases.  I try to avoid pipes when they
aren't needed out of habit, but the difference in characters
typed or performance is negligable.  The rpm globbing
support is quite limited, so if you need a more flexible
search string, then grep wins.

One thing note when passing globs to commands like this is
that it's important to quote or escape the glob to prevent
the shell from expanding it.  So either of these work:

    rpm -qa 'pulseaudio*'
    rpm -qa pulseaudio\*

It also works without the quotes as long as you don't have
anything which matches pulseaudio* in the directory where
you run the command.  That lulls many people into complaceny
and then they're surprised when they run it somewhere the
glob is exapnded by the shell and the command behaves
differently.  It's a good habit to always protect those
globs from the shell.

-- 
Todd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You will never find time for anything.  If you want time you must make
it.
    -- Charles Buxton

Attachment: signature.asc
Description: PGP signature

_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx/message/HXV4SP55ZT5XOSCOWTMDFOGBY2VOGFZF/
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux