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 10-12-2012, 09:49 AM   #1
rmknox
Member
 
Registered: May 2010
Posts: 354

Rep: Reputation: 34
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 18.04-14.04, Scientific Linux 6.3-6.4, Android-x86, Pretty much all distros at one point...
Posts: 1,802

Rep: Reputation: 157Reputation: 157
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: 354

Original Poster
Rep: Reputation: 34
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 18.04-14.04, Scientific Linux 6.3-6.4, Android-x86, Pretty much all distros at one point...
Posts: 1,802

Rep: Reputation: 157Reputation: 157
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: 354

Original Poster
Rep: Reputation: 34
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



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
[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

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

All times are GMT -5. The time now is 12:12 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