Article 5RS9A Print lines in txt file with start and end variable

Print lines in txt file with start and end variable

by
dr.x
from LinuxQuestions.org on (#5RS9A)
Hello Folks .

I need a way to print the lines in a txt file with top of X and bottom of Y

lets say iptables file below

-A PREROUTING -j X61

-A X61 -d 194.18.19.2/32 -p tcp -m tcp --dport 65282 -m limit --limit 1500/sec -j DNAT --to-destination :6100-6119 --random
-A X61 -d 194.18.19.2/32 -p tcp -m tcp --dport 65283 -m limit --limit 1500/sec -j DNAT --to-destination :6100-6119 --random
-A X61 -d 194.18.19.2/32 -p tcp -m tcp --dport 65284 -m limit --limit 1500/sec -j DNAT --to-destination :6100-6119 --random
-A X61 -d 194.18.19.2/32 -p tcp -m tcp --dport 65285 -m limit --limit 1500/sec -j DNAT --to-destination :6100-6119 --random
-A X61 -j RETURN

I want to print the lines under '-A PREROUTING -j X61'

and above '-A X61 -j RETURN'

So basically I want to have 2 variable UP and down to print the lines below only :

-A X61 -d 194.18.19.2/32 -p tcp -m tcp --dport 65282 -m limit --limit 1500/sec -j DNAT --to-destination :6100-6119 --random
-A X61 -d 194.18.19.2/32 -p tcp -m tcp --dport 65283 -m limit --limit 1500/sec -j DNAT --to-destination :6100-6119 --random
-A X61 -d 194.18.19.2/32 -p tcp -m tcp --dport 65284 -m limit --limit 1500/sec -j DNAT --to-destination :6100-6119 --random
-A X61 -d 194.18.19.2/32 -p tcp -m tcp --dport 65285 -m limit --limit 1500/sec -j DNAT --to-destination :6100-6119 --random

Thankslatest?d=yIl2AUoC8zA latest?i=jLx9LObApZk:eVl6BJdZSE4:F7zBnMy latest?i=jLx9LObApZk:eVl6BJdZSE4:V_sGLiP latest?d=qj6IDK7rITs latest?i=jLx9LObApZk:eVl6BJdZSE4:gIN9vFw
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments