>I need help with grep. A korn shell script I'm modifying uses a grep
>with a -e option. The grep on our solaris 2.6 workstation does not
>list -e as an option. In over versions of grep, what does the -e
>option do. WHat equivalent do I use in Solaris?
RTFM:
/usr/xpg4/bin/grep
The following options are supported for /usr/xpg4/bin/grep
only:
-e pattern_list
Specify one or more patterns to be used dur-
ing the search for input. Patterns in
pattern_list must be separated by a NEWLINE
character. A null pattern can be specified
by two adjacent newline characters in
pattern_list. Unless the -E or -F option is
also specified, each pattern will be treated
as a basic regular expression. Multiple -e
and -f options are accepted by grep. All of
the specified patterns are used when matching
lines, but the order of evaluation is
unspecified.
GNU grep also supports this.
Quote:>Here is example code:
> grep -e Error -e Warning $logfiles
>Should I be using egrep?
You could:
egrep 'Error|Warning' $logfiles
But if you needed to protect patterns beginning with '-', you would have to
use a version of grep that supports -e.
--
GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.