We help IT Professionals succeed at work.

Bash Script - egrep missing... How do to do it with grep

Yves_
Yves_ asked
on
Hello everybody,

Thanks to woolmilkporc I have a script with this lines (original thread was http://www.experts-exchange.com/Programming/System/Linux/Q_27450358.html)

aa=$(egrep "<title>|<link>|<description>" rss.xml |awk -F"<|>" '{print $3}' | grep -B1 "$1" | grep -v "$1")
bb=$(egrep "<title>|<link>|<description>" rss.xml |awk -F"<|>" '{print $3}' | grep -A1 "$1" | grep -v "$1")

Which workes really good on a system with egrep... But now I also have a system that does not even have egrep :( So I wanted to ask how to modify those lines that it works without egrep?

Thanks a lot for your help
Yves
Comment
Watch Question

Most Valuable Expert 2013
Top Expert 2013
Commented:
Hi,

use grep -E

wmp
ozo
Most Valuable Expert 2014
Top Expert 2015

Commented:
awk -F"<|>" '/<title>|<link>|<description>/{print $3}' rss.xml