LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (http://www.linuxquestions.org/questions/fedora-35/)
-   -   YUM w/ Perl like Regular Expressions (http://www.linuxquestions.org/questions/fedora-35/yum-w-perl-like-regular-expressions-915794/)

snmcdonald 11-27-2011 10:19 AM

YUM w/ Perl like Regular Expressions
 
How can I use Perl like regex w/ YUM? I know Debian based package managers use regular expressions by default. I seem to be able to only use "wildcard" and "glob" like search expressions.

The manpage did not give an example. The CentOS and Fedora docs do not give an example and only state:

Quote:

Regular Expressions
Use Perl or Python regular expressions to carry out more complex queries.
Is there a switch/flag I need to activate? Can someone please post an example?

jmc1987 11-27-2011 04:01 PM

http://www.centos.org/docs/5/html/yu...-packages.html
Quote:

[Tip] Regular Expressions

Use Perl or Python regular expressions to carry out more complex queries.
should have your answer

snmcdonald 11-27-2011 09:06 PM

Quote:

Originally Posted by jmc1987 (Post 4535511)

Unfortunately not, it just says "Use Perl or Python regular expressions to carry out more complex queries." without examples.

snmcdonald 11-27-2011 09:14 PM

Code:

yum list | awk '$1 ~ /^openoffice\.org-[^l].*$/ { print $1 }' | xargs yum install
-http://serverfault.com/questions/286...lar-expression

I suppose you could do something similar:

Code:

yum list | perl -ne '/regex/ && print'
-http://www.catonmat.net/blog/perl-on...ined-part-six/

It doesn't seem ideal, but it works.


All times are GMT -5. The time now is 02:16 AM.