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,924
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'

"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB