On Tue, 25 Mar 2003 11:31:08 -0800, Patrick Nelson wrote
Ben Russo wrote:
Mike Vanecek wrote:
Been at it too long, looked in the Reg Expression book, but just can
not see it. Would some kind soul please tell what I am doing wrong
here:
I want to look at messages and ignore lines
Mike Vanecek wrote:
Been at it too long, looked in the Reg Expression book, but just can not see
it. Would some kind soul please tell what I am doing wrong here:
I want to look at messages and ignore lines that have asia1 or asia2 in them:
grep -vie '(asia1|asia2)' /var/log/messages | less
I
Try grep -w
-Steve
-Original Message-
From: Distribution Lists [mailto:[EMAIL PROTECTED]
Sent: Monday, March 17, 2003 8:47 AM
To: [EMAIL PROTECTED]
Subject: grep an exact match
Can anyone tell me the syntax for grep to grep and an exact match,
rather than grep 'something1' and get
Depends on what you are expecting.
grep 'something1 ' (space after 1) will match only that.
grep 'something1$' will match something1 at the end of a line
grep 'something1[ $\.' (space, dollar sign and backspace period) will
match something1 followed by either a period, as in end of sentence,
or
Rigler, Steve wrote:
Try grep -w
That will work if the word is on a line by itself. If there may be other
words on the line, try this:
grep '\Wsomething\W'
That will match the target string only if it surrounded by non-word
characters (whitespace, puncutation, end-of-line).
Tony
--
Anthony
PROTECTED]
Sent: Monday, March 17, 2003 9:13 AM
To: [EMAIL PROTECTED]
Subject: Re: grep an exact match
Rigler, Steve wrote:
Try grep -w
That will work if the word is on a line by itself. If there may be other
words on the line, try this:
grep '\Wsomething\W'
That will match the target string
Rigler, Steve wrote:
From man grep:
-w, --word-regexp
[snip]
I stand corrected.
That's what I get for answering these questions from memory.
Tony
--
Anthony E. Greene mailto:[EMAIL PROTECTED]
OpenPGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26 C484 A42A 60DD 6C94 239D
AOL/Yahoo Chat:
* Dan Gervais
I have recently upgraded to RH7.3 and I have several shell scripts that use the GREP
command quite extensively. The problem that I have is that the version of GREP
(2.5.1) that comes with this release of RH is 114076 bytes in size, about 10 times
larger than the version I used
On Wed, Feb 19, 2003 at 09:32:45AM -0500, Dan Gervais wrote:
[...]
have is that the version of GREP (2.5.1) that comes with this
release of RH is 114076 bytes in size, about 10 times larger than
the version I used on my old Sun box.
[...]
As an aside: GNU grep (which is what comes with RHL) is
Perhaps save text option (sticky bit) will help.
Causes the program's text to be saved in memory for faster subsequent execution.
chmod o+t /bin/grep
Rick
-Original Message-
From: Dan Gervais [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 19, 2003 9:33 AM
To: [EMAIL
On Wed, 19 Feb 2003, Rick Carroll wrote:
Perhaps save text option (sticky bit) will help.
Causes the program's text to be saved in memory for faster subsequent execution.
chmod o+t /bin/grep
i'm pretty sure that option has long since lost any value.
rday
--
redhat-list mailing list
On Wed, 19 Feb 2003, Rick Carroll wrote:
Perhaps save text option (sticky bit) will help.
Causes the program's text to be saved in memory for faster subsequent execution.
chmod o+t /bin/grep
i'm pretty sure that option has long since lost any value.
rday
How about looking at
from info regex:
Alternatives match one of a choice of regular expressions: if you put
the character(s) representing the alternation operator between any two
regular expressions A and B, the result matches the union of the
strings that A and B match. For example, supposing that `|' is the
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 19-Sep-2002/09:38 -0500, Blake C. Lewis [EMAIL PROTECTED] wrote:
from info regex:
[snip]
I found the same info in regex(7) but the key is to use it with egrep, not
grep.
Tony
- --
Anthony E. Greene mailto:[EMAIL PROTECTED]
OpenPGP Key:
To: [EMAIL PROTECTED]
Subject: Re: grep 'or'
from info regex:
Alternatives match one of a choice of regular expressions:
if you put
the character(s) representing the alternation operator between any two
regular expressions A and B, the result matches the union of the
strings that A and B
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 18-Sep-2002/17:34 -0700, smoke [EMAIL PROTECTED] wrote:
is there a way to or grep?
like grep a or b
administrivia
Please do not use Reply to start a new thread.
Even if you change the subject, the new message is still threaded with the
thanks
__
Do you Yahoo!?
New DSL Internet Access from SBC Yahoo!
http://sbc.yahoo.com
--
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list
I have recently played around with chkrootkit and I want it to check
every day in the crontab and e-mail me any errors it receives. I was
wondering if anyone here would know what commands I would put into the
grep so that it would e-mail me a file that it found infected but not
not infected.
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Tuesday 18 June 2002 11:23 pm, Jon Gaudette wrote:
I have recently played around with chkrootkit and I want it to check
every day in the crontab and e-mail me any errors it receives. I was
wondering if anyone here would know what commands I
On Sun, 2 Jul 2000, Anthony E. Greene wrote:
SoloCDM wrote:
While using grep, what is the best way to search for two subjects
within the same line instead of the following?
cat filename | grep subject_one | grep subject_two
This is not an "or" search with "-e", but an "and"
Mike McNally wrote:
grep 'subject1.*subject2'
With this lineup, one must know the exact order of the subjects.
Having more than two subjects and lining them correctly will get
tedious, time consuming, and make script construction more involved.
-Original Message-
From: SoloCDM
can we use egrep?
egrep "subject1|subject2"
SoloCDM wrote:
Mike McNally wrote:
grep 'subject1.*subject2'
With this lineup, one must know the exact order of the subjects.
Having more than two subjects and lining them correctly will get
tedious, time consuming, and make script
I'm not sure what you are trying to achieve exactly, but this is easily
done is a short perl script.
You cannot do what you are asking without invoking grep twice.
charles
On Mon, 3 Jul 2000, SoloCDM wrote:
The problem I'm up against is contingent on another issue --
insensitive casing.
SoloCDM wrote:
While using grep, what is the best way to search for two subjects
within the same line instead of the following?
cat filename | grep subject_one | grep subject_two
This is not an "or" search with "-e", but an "and" search.
grep "^Subject:.*subject1.*subject2" filename
SoloCDM wrote:
While using grep, what is the best way to search for two subjects
within the same line instead of the following?
cat filename | grep subject_one | grep subject_two
This is not an "or" search with "-e", but an "and" search.
something like :
grep subject1.+subject2 filename
25 matches
Mail list logo