LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   syntax question (http://www.linuxquestions.org/questions/linux-newbie-8/syntax-question-4175431864/)

rmknox 10-12-2012 09:49 AM

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?

catalys 10-12-2012 01:40 PM

Try:
Quote:

rpm --help
You will not get syntax examples, but all the options will have some explanations.

JaseP 10-12-2012 02:28 PM

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

rmknox 10-12-2012 06:12 PM

Quote:

Originally Posted by JaseP (Post 4804203)
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

JaseP 10-12-2012 06:23 PM

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?

rmknox 10-12-2012 07:43 PM

Quote:

Originally Posted by JaseP (Post 4804331)
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


All times are GMT -5. The time now is 07:54 AM.