LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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
 
LinkBack Search this Thread
Old 10-12-2012, 09:49 AM   #1
rmknox
Member
 
Registered: May 2010
Posts: 351

Rep: Reputation: 29
syntax question


given the line
Quote:
rpm -qa *\nvidia\* *\kernel\*|sort
can you help me understand the *\whatever\* notation
it appears that rpm is told to query all
but then restrict its output to entries with nvidia or kernel
but neither man bash or man rpm explains the use of these "kinda like comment" markers *\ and \*

how do i interpret these?
where could i read about these?
 
Old 10-12-2012, 01:40 PM   #2
catalys
LQ Newbie
 
Registered: Jul 2010
Posts: 3

Rep: Reputation: 0
Try:
Quote:
rpm --help
You will not get syntax examples, but all the options will have some explanations.
 
Old 10-12-2012, 02:28 PM   #3
JaseP
Senior Member
 
Registered: Jun 2002
Location: Eastern PA, USA
Distribution: K/Ubuntu 10.04/12.04, Scientific Linux 6.3, Android-x86, Maemo
Posts: 1,658

Rep: Reputation: 138Reputation: 138
The use of the asterisk and backslash are as wildcards...

See here for a fairly concise explanation;

http://linux.about.com/od/lts_guide/a/gdelts66t00.htm
 
1 members found this post helpful.
Old 10-12-2012, 06:12 PM   #4
rmknox
Member
 
Registered: May 2010
Posts: 351

Original Poster
Rep: Reputation: 29
Quote:
Originally Posted by JaseP View Post
The use of the asterisk and backslash are as wildcards...

See here for a fairly concise explanation;

http://linux.about.com/od/lts_guide/a/gdelts66t00.htm
Jase - thanks much

unless I'm wrong the author has his syntax off
i think the purpose of the slashes is to protect the stars
there is no need to protect the leading n in nvidia

thus wouldn't the correct syntax be

rpm -qa /*nvidia/* /*kernel/* ... etc

protecting the n does no harm but also does no good?

Dick
PS I used the wrong slashes above

Last edited by rmknox; 10-12-2012 at 10:22 PM. Reason: oops
 
Old 10-12-2012, 06:23 PM   #5
JaseP
Senior Member
 
Registered: Jun 2002
Location: Eastern PA, USA
Distribution: K/Ubuntu 10.04/12.04, Scientific Linux 6.3, Android-x86, Maemo
Posts: 1,658

Rep: Reputation: 138Reputation: 138
I think you are correct,... unless this is from some other scripting language, other than the Bourne Again Shell...

Does running the script with the "fixes" yield more results?
 
Old 10-12-2012, 07:43 PM   #6
rmknox
Member
 
Registered: May 2010
Posts: 351

Original Poster
Rep: Reputation: 29
Quote:
Originally Posted by JaseP View Post
I think you are correct,... unless this is from some other scripting language, other than the Bourne Again Shell...

Does running the script with the "fixes" yield more results?
same result - but IMHO because there is no harm in protecting the n of nvidia or the k of kernel
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] What is the syntax of this question? raviteja_s Linux - Networking 1 10-07-2010 11:34 PM
If...then...else syntax question kaplan71 Linux - Software 8 10-14-2009 10:32 PM
Question of syntax kaplan71 Linux - Software 1 05-05-2009 02:45 PM
question about C++ syntax bx.s Programming 3 07-27-2006 07:50 PM
C++ syntax question jiml8 Programming 6 06-20-2006 04:19 PM


All times are GMT -5. The time now is 04:42 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration