Results 1 to 3 of 3
Hi geeks
I have started to learn linux, loving it already, but stuck with a problem, please help me move ahead.
Following command getting me results as expected except one ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 09-30-2009 #1Just Joined!
- Join Date
- Sep 2009
- Posts
- 8
grep with regular exp
Hi geeks
I have started to learn linux, loving it already, but stuck with a problem, please help me move ahead.
Following command getting me results as expected except one problem.
egrep -w -A1 'he.*o'
the problem is I need to print next line only if the first line ends with a /
Thanks in advance.
Leo
- 10-01-2009 #2Linux User
- Join Date
- Jan 2007
- Location
- cleveland
- Posts
- 468
> ...the first line ends with a /
query whether you intended '\' the line continuation character?
if so, then one way to do this is, remove the '\' and associated
newline (use "tr") then "egrep -w" as beforethe sun is new every day (heraclitus)
- 10-01-2009 #3Linux Newbie
- Join Date
- Mar 2009
- Posts
- 228
Try this:
Code:grep -w -A1 'he.*o.*/$'


Reply With Quote
