01-15-2010
Or explained anther way:
.* will glob - be expanded to a list of files that have a leading dot in the filename
'.*' is a regular expression when used as an argument to grep
* is a shell metacharacter, '*' is just an asterisk character which has to be interpreted by a program other than the shell if it is going to have a special meaning.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
What is the main difference between grep and sed (1 Reply)
Discussion started by: ss4u
1 Replies
2. Shell Programming and Scripting
Hi Guys,
I need to set the value of $7 to zero in case $7 is NULL. I've tried the below command but doesn't work. Any ideas. thanks guys.
MEM=`ps v $PPID| grep -i db2 | grep -v grep| awk '{ if ( $7 ~ " " ) { print 0 } else { print $7}}' `
Harby. (4 Replies)
Discussion started by: hariza
4 Replies
3. UNIX Desktop Questions & Answers
Hi All,
Can anyone please explain me the difference between grep, egrep and fgrep with examples.
I am new to unix environment.. Your help is highly appreciated.
Regards,
ravi (2 Replies)
Discussion started by: ravind27
2 Replies
4. UNIX for Dummies Questions & Answers
Hi All,
Please i need to know the difference between grep, egrep & grep -i when used to serach through a file.
My platform is SunOS 5.9 & i'm using the korn shell.
Regards,
- divroro12 - (2 Replies)
Discussion started by: divroro12
2 Replies
5. Shell Programming and Scripting
Hi,
I need to know the difference between this commands:
grep * *search*
grep "*" *search*
As far as i know does the 2nd command search for files which have a name with *search* and greps then all which have chars from a-z in the file content.
But was does the first command??
Best... (1 Reply)
Discussion started by: xus
1 Replies
6. UNIX for Dummies Questions & Answers
Hello.
I want to get all modules which are loaded and which name are exactly 2 characters long and not more than 2 characters and begin with "nv"
lsmod | (e)grep '^nv????????????
I want to get all modules which are loaded and which name begin with "nv" and are 2 to 7 characters long
... (1 Reply)
Discussion started by: jcdole
1 Replies
7. Programming
I think both write at the end of the file ......
but is there a sharp difference between those 2 instruction .....
thank you
this is my 3rd question today forgive me :D (1 Reply)
Discussion started by: fwrlfo
1 Replies
8. UNIX for Dummies Questions & Answers
Not certain the title is phrased correctly but here's the issue:
I need to scrape data out of a pdf file. I ftp the file from windows to unix(solaris 10) as a binary file. Open the file in vi and search for a string, Matrix, but no joy. Then I cat the same file, pipe it to grep 'Matrix' and the... (3 Replies)
Discussion started by: rj0
3 Replies
9. Shell Programming and Scripting
i have this line of code that looks for the same file if it is currently running and returns the count.
`ps -eaf -o args | grep -i sfs_pcard_load_file.ksh | grep -v grep | wc -l`
basically it is assigned to a variable
ISRUNNING=`ps -eaf -o args | grep -i sfs_pcard_load_file.ksh |... (6 Replies)
Discussion started by: wtolentino
6 Replies
10. Shell Programming and Scripting
In the awk I am trying to subtract the difference $3-$2 of each matching $4 before the first _ (underscore) and print that value in $13.
I think the awk will do that, but added comments. What I am not sure off is how to add a line or lines that will add sum each matching $13 value and put it in... (2 Replies)
Discussion started by: cmccabe
2 Replies
WILDMAT(3) Library Functions Manual WILDMAT(3)
NAME
wildmat - perform shell-style wildcard matching
SYNOPSIS
int
wildmat(text, pattern)
char *text;
char *pattern;
DESCRIPTION
Wildmat is part of libinn (3). Wildmat compares the text against the pattern and returns non-zero if the pattern matches the text. The
pattern is interpreted according to rules similar to shell filename wildcards, and not as a full regular expression such as those handled
by the grep(1) family of programs or the regex(3) or regexp(3) set of routines.
The pattern is interpreted as follows:
x Turns off the special meaning of x and matches it directly; this is used mostly before a question mark or asterisk, and is not spe-
cial inside square brackets.
? Matches any single character.
* Matches any sequence of zero or more characters.
[x...y]
Matches any single character specified by the set x...y. A minus sign may be used to indicate a range of characters. That is,
[0-5abc] is a shorthand for [012345abc]. More than one range may appear inside a character set; [0-9a-zA-Z._] matches almost all of
the legal characters for a host name. The close bracket, ], may be used if it is the first character in the set. The minus sign,
-, may be used if it is either the first or last character in the set.
[^x...y]
This matches any character not in the set x...y, which is interpreted as described above. For example, [^]-] matches any character
other than a close bracket or minus sign.
HISTORY
Written by Rich $alz <rsalz@uunet.uu.net> in 1986, and posted to Usenet several times since then, most notably in comp.sources.misc in
March, 1991.
Lars Mathiesen <thorinn@diku.dk> enhanced the multi-asterisk failure mode in early 1991.
Rich and Lars increased the efficiency of star patterns and reposted it to comp.sources.misc in April, 1991.
Robert Elz <kre@munnari.oz.au> added minus sign and close bracket handling in June, 1991.
This is revision 1.10, dated 1992/04/03.
SEE ALSO
grep(1), regex(3), regexp(3).
WILDMAT(3)