I want to print section (paragraph) of text between lines contains regexp, please help, how it could be done by grep, not awk or sed, or find regexp by grep and print with awk|sed. I use it in script, and regexp - is variable. param - is a pattern of extended regular expression (ERE)
awk -v RS="<section>" "/$param/" "$FILE" <!--it's now, but I need to find param by grep-->
example of the file:
<section>
interface gigabitEthernet 7 // 192.168.248.200
switchport access vlan 1
switchport mode access
port shutdown
<section>
interface gigabitEthernet 8 //
switchport access vlan 2
switchport mode trunk
<section>