LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-09-2006, 10:53 AM   #1
Akhran
Member
 
Registered: Aug 2005
Distribution: Debian 'lenny'
Posts: 208

Rep: Reputation: 30
Question on aptitude search pattern


Sorry for the repeated post... how do I delete the posting?

Thanks.


I'm searching for a package called 'libstdc++2.10-glibc2.2'.
Code:
aptitude search libstdc++2.10-glibc2.2
or
Code:
aptitude search 'libstdc++2.10-glibc2.2'
or
Code:
aptitude search "libstdc++2.10-glibc2.2"
does not return me any result.

However, if I use
Code:
aptitude search libstdc.*2.10-glibc2.2
the package is found.

Any reason why the first three commands do not return the expected package?

Thanks !

Last edited by Akhran; 02-09-2006 at 10:57 AM.
 
Old 02-09-2006, 11:03 AM   #2
barrulus
LQ Newbie
 
Registered: Feb 2006
Location: Wales
Distribution: Fedora, SuSE, CentOS, Ubuntu
Posts: 13

Rep: Reputation: 0
stnadard file globbing rules apply.

the + is a charachter that bash/csh/zsh etc see as a potential argument so it needs to be commented or excluded form the string.

a typical way to do this is using \ so libstdc\+\+etc...

remember, the exact way you would handle searching for strings using grep is how you can use aptitude/apt (in fact I think grep is what is used in the bg
 
Old 02-10-2006, 06:52 AM   #3
Akhran
Member
 
Registered: Aug 2005
Distribution: Debian 'lenny'
Posts: 208

Original Poster
Rep: Reputation: 30
I've the impression that the quotas (and double quotes) will prevent any characters in the enclosed string from being interpreted as a potential arguement.

Guess I'm wrong.

Thanks for the pointer

Quote:
Originally Posted by barrulus
stnadard file globbing rules apply.

the + is a charachter that bash/csh/zsh etc see as a potential argument so it needs to be commented or excluded form the string.

a typical way to do this is using \ so libstdc\+\+etc...

remember, the exact way you would handle searching for strings using grep is how you can use aptitude/apt (in fact I think grep is what is used in the bg
 
Old 02-10-2006, 08:11 AM   #4
barrulus
LQ Newbie
 
Registered: Feb 2006
Location: Wales
Distribution: Fedora, SuSE, CentOS, Ubuntu
Posts: 13

Rep: Reputation: 0
Quote:
Originally Posted by Akhran
I've the impression that the quotas (and double quotes) will prevent any characters in the enclosed string from being interpreted as a potential arguement.
hehe, don't quote me, I just know that when using grep through my logs I have to do the whole...

cat /var/log/messages |grep -i "running\ out\ of"

otherwise even with the quotes grep sees multiple arguments.

if what I told you doesn't work properly, try as my grep string with the double quotes AND the backslash....
 
Old 02-10-2006, 12:39 PM   #5
saman007uk
Member
 
Registered: Dec 2003
Location: ~root
Distribution: Debian
Posts: 364

Rep: Reputation: 33
Quote:
Originally Posted by barrulus
hehe, don't quote me, I just know that when using grep through my logs I have to do the whole...

cat /var/log/messages |grep -i "running\ out\ of"

otherwise even with the quotes grep sees multiple arguments.

if what I told you doesn't work properly, try as my grep string with the double quotes AND the backslash....
Thats how its supposed to work. You should use something like:
Code:
cat /var/log/messages |grep -i running[[:space:]]out[[:space:]]of
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the wajig equivalent command for 'aptitude search'? Akhran Debian 3 11-04-2005 02:01 AM
pattern search through find command. abhi Linux - Newbie 2 04-11-2005 10:31 AM
search for pattern in files and replace mizuki26 Linux - Newbie 3 01-04-2004 11:57 AM
Pattern search in a line jitz Linux - General 2 12-06-2003 04:50 AM
multiline pattern search in a file mimi Linux - General 1 09-01-2002 12:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration