You are not logged in.

#1 2023-08-15 23:30:43

Niinu
Member
Registered: 2020-12-13
Posts: 1

Wildcards in package queries

I need the the output of:
pacman -Qq | grep '*-git'
But it gives a no matches found error.

Meanwhile running only:
pacman -Qq | grep git
produces a boatload of packages including git, which is not desired for the output.

The only mentions about globs in the man page are about the --overwrite flag when upgrading.

And the only thread I find about pacman and globs is from 2004 where a developer says they're a work in progress.
https://bbs.archlinux.org/viewtopic.php … 036#p46036

Do pacman queries still not support globbing in 2023?

Offline

#2 2023-08-16 00:16:10

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,712
Website

Re: Wildcards in package queries

Niinu wrote:

pacman -Qq | grep '*-git'

That's not how grep works.  Globs and regular-expressions are not the same thing.

With that, pacman does not use (shell style) globs for searching, but can / does use regular expressions:

pacman -Qsq '.*-git'

To Be A Dev: propose idea; invite feedback; mock, ridicule, and ostracize any critical feedback; but be warm and kind to those who kiss your ring.

Offline

Board footer

Powered by FluxBB