Thursday, August 6, 2009

Grep either of two strings in unix:

The following command can be used to find either string1 or string2 in UNIX

egrep '(string1 | string2)'

Check out the following link:
http://www.unix.com/shell-programming-scripting/25598-how-grep-two-more-words-line-same-time.html

2 comments:

Anonymous said...

I had to do something a little different, presumably due to a different version?

% echo "ha" | egrep '(ha | blah)'
% echo "ha" | egrep '(ha || blah)'
ha
% egrep --version
egrep (GNU grep) 2.5.1
--snip--

Anonymous said...

Good fill someone in on and this enter helped me alot in my college assignement. Thanks you seeking your information.

Powered By Blogger